name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hadoop_OpenFileCtxCache_cleanAll_rdh
// Evict all entries void cleanAll() { ArrayList<OpenFileCtx> cleanedContext = new ArrayList<OpenFileCtx>(); synchronized(this) { Iterator<Entry<FileHandle, OpenFileCtx>> it = openFileMap.entrySet().iterator(); if (LOG.isTraceEnabled()) { LOG.trace("openFileMap size:" + siz...
3.26
hadoop_AMRMClientRelayerMetrics_getInstance_rdh
/** * Initialize the singleton instance. * * @return the singleton */ public static AMRMClientRelayerMetrics getInstance() { if (!isInitialized.get()) { synchronized(AMRMClientRelayerMetrics.class) { if (instance == null) { instance = new AMRMClientRelayerMetrics(); ...
3.26
hadoop_ECBlockGroup_getErasedCount_rdh
/** * Get erased blocks count * * @return erased count of blocks */ public int getErasedCount() { int erasedCount = 0; for (ECBlock dataBlock : dataBlocks) { if (dataBlock.isErased()) erasedCount++; } for (ECBlock parityBlock : parityBlocks) { if (parityBlock.isErased()) er...
3.26
hadoop_ECBlockGroup_getDataBlocks_rdh
/** * Get data blocks * * @return data blocks */ public ECBlock[] getDataBlocks() { return dataBlocks;}
3.26
hadoop_ECBlockGroup_getParityBlocks_rdh
/** * Get parity blocks * * @return parity blocks */ public ECBlock[] getParityBlocks() { return parityBlocks; }
3.26
hadoop_TaskAttemptContainerLaunchedEvent_getShufflePort_rdh
/** * Get the port that the shuffle handler is listening on. This is only * valid if the type of the event is TA_CONTAINER_LAUNCHED * * @return the port the shuffle handler is listening on. */ public int getShufflePort() { return shufflePort; }
3.26
hadoop_IOUtilsClient_cleanupWithLogger_rdh
/** * Close the Closeable objects and <b>ignore</b> any {@link IOException} or * null pointers. Must only be used for cleanup in exception handlers. * * @param log * the log to record problems to at debug level. Can be null. * @param closeables * the objects to close */ public static void cleanupWithLogger...
3.26
hadoop_PendingSet_serializer_rdh
/** * Get a shared JSON serializer for this class. * * @return a serializer. */ public static JsonSerialization<PendingSet> serializer() { return new JsonSerialization<>(PendingSet.class, false, false); }
3.26
hadoop_PendingSet_size_rdh
/** * Number of commits. * * @return the number of commits in this structure. */ public int size() { return commits != null ? commits.size() : 0; }
3.26
hadoop_PendingSet_putExtraData_rdh
/** * Set/Update an extra data entry. * * @param key * key * @param value * value */ public void putExtraData(String key, String value) { extraData.put(key, value);}
3.26
hadoop_PendingSet_getVersion_rdh
/** * * @return the version marker. */ public int getVersion() { return f0; }
3.26
hadoop_PendingSet_getCommits_rdh
/** * * @return commit list. */ public List<SinglePendingCommit> getCommits() { return commits; }
3.26
hadoop_PendingSet_validate_rdh
/** * Validate the data: those fields which must be non empty, must be set. * * @throws ValidationFailure * if the data is invalid */ public void validate() throws ValidationFailure { verify(f0 == VERSION, "Wrong version: %s", f0); validateCollectionClass(extraData.keySet(), String.class); validateCo...
3.26
hadoop_PendingSet_load_rdh
/** * Load an instance from a file, then validate it. * * @param fs * filesystem * @param path * path * @param status * status of file to load * @return the loaded instance * @throws IOException * IO failure * @throws ValidationFailure * if the data is invalid */ public static PendingSet load(Fi...
3.26
hadoop_PendingSet_m0_rdh
/** * Add a commit. * * @param commit * the single commit */ public void m0(SinglePendingCommit commit) { commits.add(commit); // add any statistics. IOStatisticsSnapshot st = commit.getIOStatistics(); if (st != null) { iostats.aggre...
3.26
hadoop_PendingSet_m1_rdh
/** * * @return Job ID, if known. */ public String m1() { return jobId; }
3.26
hadoop_PendingSet_readObject_rdh
/** * Deserialize via java Serialization API: deserialize the instance * and then call {@link #validate()} to verify that the deserialized * data is valid. * * @param inStream * input stream * @throws IOException * IO problem or validation failure * @throws ClassNotFoundException * reflection problems ...
3.26
hadoop_ApplicationPlacementAllocatorFactory_getAppPlacementAllocator_rdh
/** * Get AppPlacementAllocator related to the placement type requested. * * @param appPlacementAllocatorName * allocator class name. * @param appSchedulingInfo * app SchedulingInfo. * @param schedulerRequestKey * scheduler RequestKey. * @param rmContext * RMContext. * @return Specific AppPlacementAl...
3.26
hadoop_RouterClientMetrics_incInvokedMethod_rdh
/** * Increase the metrics based on the method being invoked. * * @param method * method being invoked */ public void incInvokedMethod(Method method) { switch (method.getName()) { case "getBlockLocations" : getBlockLocationsOps.incr(); break; case "getServerDefaults" ...
3.26
hadoop_RouterClientMetrics_incInvokedConcurrent_rdh
/** * Increase the concurrent metrics based on the method being invoked. * * @param method * concurrently invoked method */ public void incInvokedConcurrent(Method method) { switch ...
3.26
hadoop_BlockBlobAppendStream_maybeSetFirstError_rdh
/** * Set {@link #firstError} to the exception if it is not already set. * * @param exception * exception to save */ private void maybeSetFirstError(IOException exception) { firstError.compareAndSet(null, exception);}
3.26
hadoop_BlockBlobAppendStream_maybeThrowFirstError_rdh
/** * Throw the first error caught if it has not been raised already * * @throws IOException * if one is caught and needs to be thrown. */ private void maybeThrowFirstError() throws IOException { if (firstError.get() != null) { firstErrorThrown = true; throw firstError.get(); } }
3.26
hadoop_BlockBlobAppendStream_setMaxBlockSize_rdh
/** * Set payload size of the stream. * It is intended to be used for unit testing purposes only. */ @VisibleForTesting synchronized void setMaxBlockSize(int size) { f0.set(size); // it is for testing only so we can abandon the previously allocated // payload this.outBuffer = ByteBuffer.allocate(f0.g...
3.26
hadoop_BlockBlobAppendStream_setCompactionBlockCount_rdh
/** * Set compaction parameters. * It is intended to be used for unit testing purposes only. */ @VisibleForTesting void setCompactionBlockCount(int activationCount) { activateCompactionBlockCount = activationCount; }
3.26
hadoop_BlockBlobAppendStream_writeBlockRequestInternal_rdh
/** * This is shared between upload block Runnable and CommitBlockList. The * method captures retry logic * * @param blockId * block name * @param dataPayload * block content */ private void writeBlockRequestInternal(String blockId, ByteBuffer dataPayload, boolean bufferPoolBuffer) { IOException lastLocalEx...
3.26
hadoop_BlockBlobAppendStream_generateNewerVersionBlockId_rdh
/** * Helper method that generates an newer (4.2.0) version blockId. * * @return String representing the block ID generated. */ private String generateNewerVersionBlockId(String prefix, long id) { String blockIdSuffix = String.format("%06d", id); byte[] v8 = (prefix + blockIdSuffix).getBytes(StandardCharsets.UTF_8)...
3.26
hadoop_BlockBlobAppendStream_generateBlockId_rdh
/** * Helper method that generates the next block id for uploading a block to * azure storage. * * @return String representing the block ID generated. * @throws IOException * if the stream is in invalid state */ private String generateBlockId() throws IOException { if ((nextBlockCount == UNSET_BLOCKS_COUNT) |...
3.26
hadoop_BlockBlobAppendStream_generateOlderVersionBlockId_rdh
/** * Helper method that generates an older (2.2.0) version blockId. * * @return String representing the block ID generated. */ private String generateOlderVersionBlockId(long id) { byte[] blockIdInBytes = new byte[8]; for (int m = 0; m < 8; m++) { blockIdInBytes[7 - m] = ((byte) ((id >> (8 * m)) & 0xff)); } ret...
3.26
hadoop_BlockBlobAppendStream_execute_rdh
/** * Execute command. */ public void execute() throws InterruptedException, IOException {if (committedBlobLength.get() >= getCommandBlobOffset()) { LOG.debug("commit already applied for {}", key); return; } if (lastBlock == null) { LOG.debug("nothing to commit for {}", key); return; } LOG.debug("active commands: {...
3.26
hadoop_BlockBlobAppendStream_hsync_rdh
/** * Force all data in the output stream to be written to Azure storage. * Wait to return until this is complete. */@Override public void hsync() throws IOException { // when block compaction is disabled, hsync is empty function if (compactionEnabled) { flush();} }
3.26
hadoop_BlockBlobAppendStream_flush_rdh
/** * Flushes this output stream and forces any buffered output bytes to be * written out. If any data remains in the payload it is committed to the * service. Data is queued for writing and forced out to the service * before the call returns. */ @Override public void flush() throws IOException { if (closed) {// ...
3.26
hadoop_BlockBlobAppendStream_write_rdh
/** * Writes length bytes from the specified byte array starting at offset to * this output stream. * * @param data * the byte array to write. * @param offset * the start offset in the data. * @param length * the number of bytes to write. * @throws IOException * if an I/O error occurs. In particular,...
3.26
hadoop_BlockBlobAppendStream_blockCompaction_rdh
/** * Block compaction process. * * Block compaction is only enabled when the number of blocks exceeds * activateCompactionBlockCount. The algorithm searches for the longest * segment [b..e) where (e-b) > 2 && |b| + |b+1| ... |e-1| < maxBlockSize * such that size(b1) + size(b2) + ... + size(bn) < maximum-block-si...
3.26
hadoop_BlockBlobAppendStream_hasCapability_rdh
/** * The Synchronization capabilities of this stream depend upon the compaction * policy. * * @param capability * string to query the stream support for. * @return true for hsync and hflush when compaction is enabled. */ @Override public boolean hasCapability(String capability) { if (!compactionEnabled) { ret...
3.26
hadoop_BlockBlobAppendStream_getBlockList_rdh
/** * Get the list of block entries. It is used for testing purposes only. * * @return List of block entries. */@VisibleForTesting List<BlockEntry> getBlockList() throws StorageException, IOException { return blob.downloadBlockList(BlockListingFilter.COMMITTED, new BlobRequestOptions(), opContext); }
3.26
hadoop_BlockBlobAppendStream_writeBlockListRequestInternal_rdh
/** * Write block list. The method captures retry logic */ private void writeBlockListRequestInternal() { IOException lastLocalException = null; int uploadRetryAttempts = 0; while (uploadRetryAttempts < MAX_BLOCK_UPLOAD_RETRIES) { try { long startTime = System.nanoTime(); blob.commitBlockList(f1, accessCondition, n...
3.26
hadoop_BlockBlobAppendStream_hflush_rdh
/** * Force all data in the output stream to be written to Azure storage. * Wait to return until this is complete. */ @Override public void hflush() throws IOException { // when block compaction is disabled, hflush is empty function if (compactionEnabled) { flush(); } }
3.26
hadoop_BlockBlobAppendStream_addFlushCommand_rdh
/** * Prepare block list commit command and queue the command in thread pool * executor. */ private synchronized UploadCommand addFlushCommand() throws IOException { maybeThrowFirstError(); if (blobExist && lease.isFreed()) { throw new AzureException(String.format("Attempting to upload block list on blob : %s" + " t...
3.26
hadoop_BlockBlobAppendStream_setBlocksCountAndBlockIdPrefix_rdh
/** * Helper method used to generate the blockIDs. The algorithm used is similar * to the Azure storage SDK. */ private void setBlocksCountAndBlockIdPrefix(List<BlockEntry> blockEntries) { if ((nextBlockCount == UNSET_BLOCKS_COUNT) && (blockIdPrefix == null)) { Random sequenceGenerator = new Random(); String block...
3.26
hadoop_ResourceMappings_addAssignedResources_rdh
/** * Adds the resources for a given resource type. * * @param resourceType * Resource Type * @param assigned * Assigned resources to add */ public void addAssignedResources(String resourceType, AssignedResources assigned) { assignedResourcesMap.put(resourceType, assigned); }
3.26
hadoop_ResourceMappings_getAssignedResources_rdh
/** * Get all resource mappings. * * @param resourceType * resourceType * @return map of resource mapping */ public List<Serializable> getAssignedResources(String resourceType) { AssignedResources ar = assignedResourcesMap.get(resourceType); if (null == ar) { return Collections.emptyList(); ...
3.26
hadoop_InMemoryLevelDBAliasMapServer_getAliasMap_rdh
/** * Get the {@link InMemoryAliasMap} used by this server. * * @return the inmemoryaliasmap used. */ public InMemoryAliasMap getAliasMap() { return aliasMap; }
3.26
hadoop_ChainReducer_setReducer_rdh
/** * Sets the {@link Reducer} class to the chain job. * * <p> * The key and values are passed from one element of the chain to the next, by * value. For the added Reducer the configuration given for it, * <code>reducerConf</code>, have precedence over the job's Configuration. * This precedence is in effect when...
3.26
hadoop_AbfsIoUtils_m0_rdh
/** * Dump the headers of a request/response to the log at DEBUG level. * * @param origin * header origin for log * @param headers * map of headers. */ public static void m0(final String origin, final Map<String, List<String>> headers) { if (LOG.isDebugEnabled()) { LOG.debug("{}", origin); ...
3.26
hadoop_ResourceEstimatorUtil_createProviderInstance_rdh
/** * Helper method to create instances of Object using the class name specified * in the configuration object. * * @param conf * the yarn configuration * @param configuredClassName * the configuration provider key * @param defaultValue * the default implementation class * @param type * the required ...
3.26
hadoop_Lz4Codec_createDecompressor_rdh
/** * Create a new {@link Decompressor} for use by this {@link CompressionCodec}. * * @return a new decompressor for use by this codec */ @Override public Decompressor createDecompressor() { int bufferSize = conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY, CommonConfigurationKeys.I...
3.26
hadoop_Lz4Codec_setConf_rdh
/** * Set the configuration to be used by this object. * * @param conf * the configuration object. */ @Override public void setConf(Configuration conf) { this.conf = conf; }
3.26
hadoop_Lz4Codec_createCompressor_rdh
/** * Create a new {@link Compressor} for use by this {@link CompressionCodec}. * * @return a new compressor for use by this codec */ @Override public Compressor createCompressor() { int bufferSize = conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY, CommonConfigurationKeys.IO_COMPRESS...
3.26
hadoop_Lz4Codec_getCompressorType_rdh
/** * Get the type of {@link Compressor} needed by this {@link CompressionCodec}. * * @return the type of compressor needed by this codec. */ @Override public Class<? extends Compressor> getCompressorType() { return Lz4Compressor.class; }
3.26
hadoop_Lz4Codec_getDefaultExtension_rdh
/** * Get the default filename extension for this kind of compression. * * @return <code>.lz4</code>. */ @Override public String getDefaultExtension() { return CodecConstants.LZ4_CODEC_EXTENSION; }
3.26
hadoop_Lz4Codec_createOutputStream_rdh
/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out * the location for the final output stream * @param compressor * compressor to use * @return a stream the user can write uncompressed data to have it compresse...
3.26
hadoop_Lz4Codec_createInputStream_rdh
/** * Create a {@link CompressionInputStream} that will read from the given * {@link InputStream} with the given {@link Decompressor}. * * @param in * the stream to read compressed bytes from * @param decompressor * decompressor to use * @return a stream to read uncompressed bytes from * @throws IOExceptio...
3.26
hadoop_ExternalSPSBlockMoveTaskHandler_cleanUp_rdh
/** * Cleanup the resources. */ void cleanUp() { blkMovementTracker.stopTracking(); if (movementTrackerThread != null) { movementTrackerThread.interrupt(); } }
3.26
hadoop_ExternalSPSBlockMoveTaskHandler_startMovementTracker_rdh
/** * Initializes block movement tracker daemon and starts the thread. */ private void startMovementTracker() { movementTrackerThread = new Daemon(this.blkMovementTracker); movementTrackerThread.setName("BlockStorageMovementTracker"); movementTrackerThread.start(); }
3.26
hadoop_FSDirSatisfyStoragePolicyOp_satisfyStoragePolicy_rdh
/** * Satisfy storage policy function which will add the entry to SPS call queue * and will perform satisfaction async way. * * @param fsd * fs directory * @param bm * block manager * @param src * source path * @param logRetryCache * whether to record R...
3.26
hadoop_FSStoreOpHandler_get_rdh
/** * Will return StoreOp instance based on opCode and StoreType. * * @param opCode * opCode. * @param storeType * storeType. * @return instance of FSNodeStoreLogOp. */ public static FSNodeStoreLogOp get(int opCode, StoreType storeType) { return newInstance(editLogOp.get(storeType).get(opCode)); }
3.26
hadoop_FSStoreOpHandler_getMirrorOp_rdh
/** * Get mirror operation of store Type. * * @param storeType * storeType. * @return instance of FSNodeStoreLogOp. */ public static FSNodeStoreLogOp getMirrorOp(StoreType storeType) { return newInstance(mirrorOp.get(storeType)); }
3.26
hadoop_GenericRefreshProtocolServerSideTranslatorPB_pack_rdh
// Convert a collection of RefreshResponse objects to a // RefreshResponseCollection proto private GenericRefreshResponseCollectionProto pack(Collection<RefreshResponse> responses) { GenericRefreshResponseCollectionProto.Builder b = GenericRefreshResponseCollectionProto.newBuilder(); for (R...
3.26
hadoop_FSBuilderSupport_getLong_rdh
/** * Get a long value with resilience to unparseable values. * * @param key * key to log * @param defVal * default value * @return long value */ public long getLong(String key, long defVal) { final String v = options.getTrimmed(key, ""); if (v.isEmpty()) { return defVal; }try { ...
3.26
hadoop_FSBuilderSupport_getPositiveLong_rdh
/** * Get a long value with resilience to unparseable values. * Negative values are replaced with the default. * * @param key * key to log * @param defVal * default value * @return long value */ public long getPositiveLong(String key, long defVal) { long l = getLong(key, defVal); if (l < 0) { LOG.d...
3.26
hadoop_ShadedProtobufHelper_tokenFromProto_rdh
/** * Create a hadoop token from a protobuf token. * * @param tokenProto * token * @return a new token */ public static Token<? extends TokenIdentifier> tokenFromProto(TokenProto tokenProto) { Token<? extends TokenIdentifier> token = new Token<>(tokenProto.getIdentifier().toByteArray(), tokenProto.getPasswo...
3.26
hadoop_ShadedProtobufHelper_getByteString_rdh
/** * Get the byte string of a non-null byte array. * If the array is 0 bytes long, return a singleton to reduce object allocation. * * @param bytes * bytes to convert. * @return the protobuf byte string representation of the array. */ public static ByteString getByteString(byte[] bytes) {// return singleton t...
3.26
hadoop_ShadedProtobufHelper_protoFromToken_rdh
/** * Create a {@code TokenProto} instance * from a hadoop token. * This builds and caches the fields * (identifier, password, kind, service) but not * renewer or any payload. * * @param tok * token * @return a marshallable proto...
3.26
hadoop_ShadedProtobufHelper_ipc_rdh
/** * Evaluate a protobuf call, converting any ServiceException to an IOException. * * @param call * invocation to make * @return the result of the call * @param <T> * type of the result * @throws IOException * any translated protobuf exception */ public static <T> T ipc(IpcCall<T> call) throws IOExcept...
3.26
hadoop_ShadedProtobufHelper_getFixedByteString_rdh
/** * Get the ByteString for frequently used fixed and small set strings. * * @param key * string * @return ByteString for frequently used fixed and small set strings. */ public static ByteString getFixedByteString(String key) { ByteString value = FIXED_BYTESTRING_CACHE.get(key); if (value == null) { ...
3.26
hadoop_OBSInputStream_onReadFailure_rdh
/** * Handle an IOE on a read by attempting to re-open the stream. The * filesystem's readException count will be incremented. * * @param ioe * exception caught. * @param length * length of data being attempted to read * @throws IOException * any exception thrown on the re-open attempt. */ private void ...
3.26
hadoop_OBSInputStream_reopen_rdh
/** * Opens up the stream at specified target position and for given length. * * @param reason * reason for reopen * @param targetPos * target position * @param length * length requested * @throws IOException * on any failure to open the object */private synchronized void reopen(final String reason, ...
3.26
hadoop_OBSInputStream_closeStream_rdh
/** * Close a stream: decide whether to abort or close, based on the length of * the stream and the current position. If a close() is attempted and fails, * the operation escalates to an abort. * * <p>This does not set the {@link #closed} flag. * * @param reason * reason for stream being closed; used in messa...
3.26
hadoop_OBSInputStream_read_rdh
/** * Read bytes starting from the specified position. * * @param position * start read from this position * @param buffer * read buffer * @param offset * offset into buffer * @param length * number of bytes to read * @return actual number of bytes read * @throws IOException * on any failure to r...
3.26
hadoop_OBSInputStream_remainingInFile_rdh
/** * Bytes left in stream. * * @return how many bytes are left to read */ @InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long remainingInFile() {return this.contentLength - this.streamCurrentPos; }
3.26
hadoop_OBSInputStream_seekInStream_rdh
/** * Adjust the stream to a specific position. * * @param targetPos * target seek position * @throws IOException * on any failure to seek */ private void seekInStream(final long targetPos) throws IOException { checkNotClosed(); if (wrappedStream == null) { return; } // compute how mu...
3.26
hadoop_OBSInputStream_incrementBytesRead_rdh
/** * Increment the bytes read counter if there is a stats instance and the * number of bytes read is more than zero. * * @param bytesRead * number of bytes read */private void incrementBytesRead(final long bytesRead) { if ((statistics != null) && (bytesRead > 0)) { statistics.incrementBytesRead(bytesRead); } ...
3.26
hadoop_OBSInputStream_readFully_rdh
/** * Subclass {@code readFully()} operation which only seeks at the start of the * series of operations; seeking back at the end. * * <p>This is significantly higher performance if multiple read attempts * are needed to fetch the data, as it does not break the HTTP connection. * * <p>To maintain thread safety r...
3.26
hadoop_OBSInputStream_remainingInCurrentRequest_rdh
/** * Bytes left in the current request. Only valid if there is an active * request. * * @return how many bytes are left to read in the current GET. */ @InterfaceAudience.Private@InterfaceStability.Unstable public synchronized long remainingInCurrentRequest() { return this.contentRangeFinish - this.streamCurrentP...
3.26
hadoop_OBSInputStream_seekQuietly_rdh
/** * Seek without raising any exception. This is for use in {@code finally} * clauses * * @param positiveTargetPos * a target position which must be positive. */ private void seekQuietly(final long positiveTargetPos) { try { seek(positiveTargetPos); } catch (IOException ioe) { LOG.debug...
3.26
hadoop_OBSInputStream_m0_rdh
/** * Calculate the limit for a get request, based on input policy and state of * object. * * @param targetPos * position of the read * @param length * length of bytes requested; if less than zero * "unknown" * @param contentLength * total length of file * @param readahead * current readahead valu...
3.26
hadoop_OBSInputStream_close_rdh
/** * Close the stream. This triggers publishing of the stream statistics back to * the filesystem statistics. This operation is synchronized, so that only one * thread can attempt to close the connection; all later/blocked calls are * no-ops. * * @throws IOException * on any problem */ @Override public synch...
3.26
hadoop_OBSInputStream_lazySeek_rdh
/** * Perform lazy seek and adjust stream to correct position for reading. * * @param targetPos * position from where data should be read * @param len * length of the content that needs to be read * @throws IOException * on any failur...
3.26
hadoop_OBSInputStream_checkNotClosed_rdh
/** * Verify that the input stream is open. Non blocking; this gives the last * state of the volatile {@link #closed} field. * * @throws IOException * if the connection is closed. */ private void checkNotClosed() throws IOException { if (closed) {throw new IOException((uri + ": ") + FSExceptionMessages.STREAM_I...
3.26
hadoop_NoopAuditManagerS3A_checkAccess_rdh
/** * Forward to the auditor. * * @param path * path to check * @param status * status of the path. * @param mode * access mode. * @throws IOException * failure */ @Override public boolean checkAccess(final Path path, final S3AFileStatus status, final FsAction mode) throws IOException { return...
3.26
hadoop_NoopAuditManagerS3A_getUnbondedSpan_rdh
/** * Unbonded span to use after deactivation. */ private AuditSpanS3A getUnbondedSpan() {return auditor.getUnbondedSpan(); }
3.26
hadoop_NoopAuditManagerS3A_createNewSpan_rdh
/** * A static source of no-op spans, using the same span ID * source as managed spans. * * @param name * operation name. * @param path1 * first path of operation * @param path2 * second path of operation * @return a span for the audit */ public static AuditSpanS3A createNewSpan(final String name, fi...
3.26
hadoop_PipesPartitioner_getPartition_rdh
/** * If a partition result was set manually, return it. Otherwise, we call * the Java partitioner. * * @param key * the key to partition * @param value * the value to partition * @param numPartitions * the number of reduces */ public int getPartition(K key, V value, int numPartitions) { Integer...
3.26
hadoop_PipesPartitioner_setNextPartition_rdh
/** * Set the next key to have the given partition. * * @param newValue * the next partition value */ static void setNextPartition(int newValue) { CACHE.set(newValue); }
3.26
hadoop_AuthenticationHandlerUtil_checkAuthScheme_rdh
/** * This method checks if the specified HTTP authentication <code>scheme</code> * value is valid. * * @param scheme * HTTP authentication scheme to be checked * @return Canonical representation of HTTP authentication scheme * @throws IllegalArgumentException * In case the specified value is not a valid *...
3.26
hadoop_AuthenticationHandlerUtil_getAuthenticationHandlerClassName_rdh
/** * This method provides an instance of {@link AuthenticationHandler} based on * specified <code>authHandlerName</code>. * * @param authHandler * The short-name (or fully qualified class name) of the * authentication handler. * @return an inst...
3.26
hadoop_OBSLoginHelper_canonicalizeUri_rdh
/** * Canonicalize the given URI. * * <p>This strips out login information. * * @param uri * the URI to canonicalize * @param defaultPort * default port to use in canonicalized URI if the input * URI has no port and this value is greater than 0 * @return a new, canonicalized URI. */ public static URI c...
3.26
hadoop_OBSLoginHelper_extractLoginDetailsWithWarnings_rdh
/** * Extract the login details from a URI, logging a warning if the URI contains * these. * * @param name * URI of the filesystem * @return a login tuple, possibly empty. */ public static Login extractLoginDetailsWithWarnings(final URI name) { Login login = extractLoginDetails(name); if (login.hasLogi...
3.26
hadoop_OBSLoginHelper_equals_rdh
/** * Equality test matches user and password. * * @param o * other object * @return true if the objects are considered equivalent. */ @Override public boolean equals(final Object o) { if (this == o) { return true; } if ((o == null) || (getClass() != o.getClass())) { return false; ...
3.26
hadoop_OBSLoginHelper_checkPath_rdh
/** * Check the path, ignoring authentication details. See {@link OBSFileSystem#checkPath(Path)} for the operation of this. * * <p>Essentially * * <ol> * <li>The URI is canonicalized. * <li>If the schemas match, the hosts are compared. * <li>If there is a mismatch between null/non-null host, * the default FS v...
3.26
hadoop_OBSLoginHelper_extractLoginDetails_rdh
/** * Extract the login details from a URI. * * @param name * URI of the filesystem * @return a login tuple, possibly empty. */ public static Login extractLoginDetails(final URI name) { try { String authority = name.getAuthority(); if (authority == null) { return Login.EMPT...
3.26
hadoop_OBSLoginHelper_buildFSURI_rdh
/** * Build the filesystem URI. This can include stripping down of part of the * URI. * * @param uri * filesystem uri * @return the URI to use as the basis for FS operation and qualifying paths. * @throws IllegalArgumentException * if the URI is in some way invalid. */ public static URI buildFSURI(final UR...
3.26
hadoop_OBSLoginHelper_toString_rdh
/** * Create a stripped down string value for error messages. * * @param pathUri * URI * @return a shortened schema://host/path value */ public static String toString(final URI pathUri) { return pathUri != null ? String.format("%s://%s/%s", pathUri.getScheme(), pathUri.getHost(), pathUri.getPath()) : "(null...
3.26
hadoop_OBSLoginHelper_hasLogin_rdh
/** * Predicate to verify login details are defined. * * @return true if the username is defined (not null, not empty). */ public boolean hasLogin() { return StringUtils.isNotEmpty(f0); }
3.26
hadoop_ContainerAllocationHistory_addAllocationEntry_rdh
/** * Record the allocation history for the container. * * @param container * to add record for * @param requestSet * resource request ask set * @param fulfillTimeStamp * time at which allocation happened * @param fulfillLatency * time elapsed in allocating since asked */ public synchronized void add...
3.26
hadoop_HsLogsPage_preHead_rdh
/* (non-Javadoc) @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ @Overrideprotected void preHead(Page.HTML<__> html) { commonPreHead(html); setActiveNavColumnForTask();}
3.26
hadoop_HsLogsPage_content_rdh
/** * The content of this page is the JobBlock * * @return HsJobBlock.class */ @Override protected Class<? extends SubView> content() { return AggregatedLogsBlock.class; }
3.26
hadoop_FileSystemNodeLabelsStore_recover_rdh
/* (non-Javadoc) @see org.apache.hadoop.yarn.nodelabels.NodeLabelsStore#recover(boolean) */ @Override public void recover() throws YarnException, IOException { super.recoverFromStore(); }
3.26
hadoop_DeleteCompletionCallback_getEventCount_rdh
/** * Get the number of deletion events * * @return the count of events */ public int getEventCount() { return events.get(); }
3.26
hadoop_ServiceLaunchException_getExitCode_rdh
/** * Get the exit code * * @return the exit code */ @Override public int getExitCode() {return exitCode; }
3.26