public class ShuffleUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SHUFFLE_HANDLER_SERVICE_ID |
Constructor and Description |
---|
ShuffleUtils() |
Modifier and Type | Method and Description |
---|---|
static StringBuilder |
constructBaseURIForShuffleHandler(String host,
int port,
int partition,
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)
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)
Generate events for outputs which have not been started.
|
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 void |
logIndividualFetchComplete(org.slf4j.Logger log,
long millis,
long bytesCompressed,
long bytesDecompressed,
String outputType,
InputAttemptIdentifier srcAttemptIdentifier)
Log individual fetch complete event.
|
static void |
shuffleToDisk(OutputStream output,
String hostIdentifier,
InputStream input,
long compressedLength,
long decompressedLength,
org.slf4j.Logger LOG,
String identifier) |
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,
String identifier) |
static String |
stringify(ShuffleUserPayloads.DataMovementEventPayloadProto dmProto) |
public static final String SHUFFLE_HANDLER_SERVICE_ID
public static SecretKey getJobTokenSecretFromTokenBytes(ByteBuffer meta) throws IOException
IOException
public static ByteBuffer convertJobTokenToBytes(org.apache.hadoop.security.token.Token<org.apache.tez.common.security.JobTokenIdentifier> jobToken) throws IOException
IOException
public static int deserializeShuffleProviderMetaData(ByteBuffer meta) throws IOException
IOException
public 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, String identifier) throws IOException
IOException
public static void shuffleToDisk(OutputStream output, String hostIdentifier, InputStream input, long compressedLength, long decompressedLength, org.slf4j.Logger LOG, String identifier) throws IOException
IOException
public static void ioCleanup(Closeable... closeables)
public static StringBuilder constructBaseURIForShuffleHandler(String host, int port, int partition, String appId, int dagIdentifier, boolean sslShuffle)
public static URL constructInputURL(String baseURI, Collection<InputAttemptIdentifier> inputs, boolean keepAlive) throws MalformedURLException
MalformedURLException
public static BaseHttpConnection getHttpConnection(boolean asyncHttp, URL url, HttpConnectionParams params, String logIdentifier, org.apache.tez.common.security.JobTokenSecretManager jobTokenSecretManager) throws IOException
IOException
public 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) throws IOException
eventList
- numPhysicalOutputs
- context
- generateVmEvent
- whether to generate a vm event or notisCompositeEvent
- whether to generate a CompositeDataMovementEvent or a DataMovementEventIOException
public 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) throws IOException
eventList
- events would be added to this listfinalMergeEnabled
- isLastEvent
- context
- spillId
- spillRecord
- numPhysicalOutputs
- pathComponent
- partitionStats
- IOException
public static org.roaringbitmap.RoaringBitmap getPartitionStatsForPhysicalOutput(long[] sizes)
sizes
- for physical outputspublic static void logIndividualFetchComplete(org.slf4j.Logger log, long millis, long bytesCompressed, long bytesDecompressed, String outputType, InputAttemptIdentifier srcAttemptIdentifier)
log
- millis
- bytesCompressed
- bytesDecompressed
- outputType
- srcAttemptIdentifier
- public static HttpConnectionParams getHttpConnectionParams(org.apache.hadoop.conf.Configuration conf)
HttpConnectionParams
from configurationconf
- Copyright © 2016 Apache Software Foundation. All rights reserved.