public class ShuffleUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ShuffleUtils.FetchStatsLogger |
| Constructor and Description |
|---|
ShuffleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static StringBuilder |
constructBaseURIForShuffleHandler(String host,
int port,
int partition,
int partitionCount,
String appId,
int dagIdentifier,
boolean sslShuffle) |
static URL |
constructInputURL(String baseURI,
Collection<InputAttemptIdentifier> inputs,
boolean keepAlive) |
static ByteBuffer |
convertJobTokenToBytes(org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> jobToken) |
static int |
deserializeShuffleProviderMetaData(ByteBuffer meta) |
static void |
generateEventOnSpill(List<org.apache.tez.runtime.api.Event> eventList,
boolean finalMergeEnabled,
boolean isLastEvent,
org.apache.tez.runtime.api.OutputContext context,
int spillId,
TezSpillRecord spillRecord,
int numPhysicalOutputs,
boolean sendEmptyPartitionDetails,
String pathComponent,
long[] partitionStats,
boolean reportDetailedPartitionStats,
String auxiliaryService,
Deflater deflater)
Generate events when spill happens
|
static void |
generateEventsForNonStartedOutput(List<org.apache.tez.runtime.api.Event> eventList,
int numPhysicalOutputs,
org.apache.tez.runtime.api.OutputContext context,
boolean generateVmEvent,
boolean isCompositeEvent,
Deflater deflater)
Generate events for outputs which have not been started.
|
static org.apache.tez.runtime.api.events.VertexManagerEvent |
generateVMEvent(org.apache.tez.runtime.api.OutputContext context,
long[] sizePerPartition,
boolean reportDetailedPartitionStats,
Deflater deflater) |
static ShuffleUserPayloads.DetailedPartitionStatsProto |
getDetailedPartitionStatsForPhysicalOutput(long[] sizes)
Detailed partition stats
|
static BaseHttpConnection |
getHttpConnection(boolean asyncHttp,
URL url,
HttpConnectionParams params,
String logIdentifier,
org.apache.tez.common.security.JobTokenSecretManager jobTokenSecretManager) |
static HttpConnectionParams |
getHttpConnectionParams(org.apache.hadoop.conf.Configuration conf)
Build
HttpConnectionParams from configuration |
static SecretKey |
getJobTokenSecretFromTokenBytes(ByteBuffer meta) |
static org.roaringbitmap.RoaringBitmap |
getPartitionStatsForPhysicalOutput(long[] sizes)
Data size for the destinations
|
static void |
ioCleanup(Closeable... closeables) |
static boolean |
isTezShuffleHandler(org.apache.hadoop.conf.Configuration config) |
static void |
shuffleToDisk(OutputStream output,
String hostIdentifier,
InputStream input,
long compressedLength,
long decompressedLength,
org.slf4j.Logger LOG,
InputAttemptIdentifier identifier,
boolean ifileReadAhead,
int ifileReadAheadLength,
boolean verifyChecksum) |
static void |
shuffleToMemory(byte[] shuffleData,
InputStream input,
int decompressedLength,
int compressedLength,
org.apache.hadoop.io.compress.CompressionCodec codec,
boolean ifileReadAhead,
int ifileReadAheadLength,
org.slf4j.Logger LOG,
InputAttemptIdentifier identifier) |
static String |
stringify(ShuffleUserPayloads.DataMovementEventPayloadProto dmProto) |
public static SecretKey getJobTokenSecretFromTokenBytes(ByteBuffer meta) throws IOException
IOExceptionpublic static ByteBuffer convertJobTokenToBytes(org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> jobToken) throws IOException
IOExceptionpublic static int deserializeShuffleProviderMetaData(ByteBuffer meta) throws IOException
IOExceptionpublic static void shuffleToMemory(byte[] shuffleData,
InputStream input,
int decompressedLength,
int compressedLength,
org.apache.hadoop.io.compress.CompressionCodec codec,
boolean ifileReadAhead,
int ifileReadAheadLength,
org.slf4j.Logger LOG,
InputAttemptIdentifier identifier)
throws IOException
IOExceptionpublic static void shuffleToDisk(OutputStream output, String hostIdentifier, InputStream input, long compressedLength, long decompressedLength, org.slf4j.Logger LOG, InputAttemptIdentifier identifier, boolean ifileReadAhead, int ifileReadAheadLength, boolean verifyChecksum) throws IOException
IOExceptionpublic static void ioCleanup(Closeable... closeables)
public static StringBuilder constructBaseURIForShuffleHandler(String host, int port, int partition, int partitionCount, String appId, int dagIdentifier, boolean sslShuffle)
public static URL constructInputURL(String baseURI, Collection<InputAttemptIdentifier> inputs, boolean keepAlive) throws MalformedURLException
MalformedURLExceptionpublic static BaseHttpConnection getHttpConnection(boolean asyncHttp, URL url, HttpConnectionParams params, String logIdentifier, org.apache.tez.common.security.JobTokenSecretManager jobTokenSecretManager) throws IOException
IOExceptionpublic static String stringify(ShuffleUserPayloads.DataMovementEventPayloadProto dmProto)
public static void generateEventsForNonStartedOutput(List<org.apache.tez.runtime.api.Event> eventList, int numPhysicalOutputs, org.apache.tez.runtime.api.OutputContext context, boolean generateVmEvent, boolean isCompositeEvent, Deflater deflater) throws IOException
eventList - numPhysicalOutputs - context - generateVmEvent - whether to generate a vm event or notisCompositeEvent - whether to generate a CompositeDataMovementEvent or a DataMovementEventdeflater - IOExceptionpublic static void generateEventOnSpill(List<org.apache.tez.runtime.api.Event> eventList, boolean finalMergeEnabled, boolean isLastEvent, org.apache.tez.runtime.api.OutputContext context, int spillId, TezSpillRecord spillRecord, int numPhysicalOutputs, boolean sendEmptyPartitionDetails, String pathComponent, @Nullable long[] partitionStats, boolean reportDetailedPartitionStats, String auxiliaryService, Deflater deflater) throws IOException
eventList - events would be added to this listfinalMergeEnabled - isLastEvent - context - spillId - spillRecord - numPhysicalOutputs - pathComponent - partitionStats - auxiliaryService - IOExceptionpublic static org.apache.tez.runtime.api.events.VertexManagerEvent generateVMEvent(org.apache.tez.runtime.api.OutputContext context,
long[] sizePerPartition,
boolean reportDetailedPartitionStats,
Deflater deflater)
throws IOException
IOExceptionpublic static org.roaringbitmap.RoaringBitmap getPartitionStatsForPhysicalOutput(long[] sizes)
sizes - for physical outputspublic static ShuffleUserPayloads.DetailedPartitionStatsProto getDetailedPartitionStatsForPhysicalOutput(long[] sizes)
sizes - actual partition sizespublic static HttpConnectionParams getHttpConnectionParams(org.apache.hadoop.conf.Configuration conf)
HttpConnectionParams from configurationconf - public static boolean isTezShuffleHandler(org.apache.hadoop.conf.Configuration config)
Copyright © 2017 Apache Software Foundation. All rights reserved.