name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_Adl_getUriDefaultPort_rdh | /**
*
* @return Default port for ADL File system to communicate
*/
@Override
public final int getUriDefaultPort() {
return AdlFileSystem.DEFAULT_PORT;
} | 3.26 |
hadoop_Configured_setConf_rdh | // inherit javadoc
@Override
public void setConf(Configuration conf) {
this.conf = conf;
} | 3.26 |
hadoop_Configured_getConf_rdh | // inherit javadoc
@Override
public Configuration getConf() {
return conf;
} | 3.26 |
hadoop_AbstractAutoCreatedLeafQueue_setEntitlement_rdh | /**
* This methods to change capacity for a queue and adjusts its
* absoluteCapacity.
*
* @param nodeLabel
* nodeLabel.
* @param entitlement
* the new entitlement for the queue (capacity,
* maxCapacity, etc..)
* @throws SchedulerDynamicEditException
* when setEntitlement fails.
*/
public void setEnti... | 3.26 |
hadoop_ECBlock_isErased_rdh | /**
*
* @return true if it's erased due to erasure, otherwise false
*/
public boolean isErased() {
return isErased;
} | 3.26 |
hadoop_ECBlock_isParity_rdh | /**
*
* @return true if it's parity block, otherwise false
*/
public boolean isParity() {
return isParity;} | 3.26 |
hadoop_ECBlock_setParity_rdh | /**
* Set true if it's for a parity block.
*
* @param isParity
* is parity or not
*/
public void
setParity(boolean isParity) {this.isParity = isParity;
} | 3.26 |
hadoop_ECBlock_setErased_rdh | /**
* Set true if the block is missing.
*
* @param isErased
* is erased or not
*/
public void setErased(boolean isErased) {
this.isErased = isErased;
} | 3.26 |
hadoop_DirectoryPolicyImpl_availablePolicies_rdh | /**
* Enumerate all available policies.
*
* @return set of the policies.
*/
public static Set<MarkerPolicy>
availablePolicies() {
return AVAILABLE_POLICIES;} | 3.26 |
hadoop_DirectoryPolicyImpl_m0_rdh | /**
* Return path policy for store and paths.
*
* @param path
* path
* @param capability
* capability
* @return true if a capability is active
*/
@Override
public boolean m0(final Path path, final String capability) {
switch (capability) {
/* Marker policy is dynamically determined for the given... | 3.26 |
hadoop_DirectoryPolicyImpl_getDirectoryPolicy_rdh | /**
* Create/Get the policy for this configuration.
*
* @param conf
* config
* @param authoritativeness
* Callback to evaluate authoritativeness of a
* path.
* @return a policy
*/
public static DirectoryPolicy getDirectoryPolicy(final Configuration conf, final... | 3.26 |
hadoop_AbfsHttpOperation_getConnOutputStream_rdh | /**
* Gets the connection output stream.
*
* @return output stream.
* @throws IOException
*/
OutputStream getConnOutputStream() throws IOException {
return connection.getOutputStream();
} | 3.26 |
hadoop_AbfsHttpOperation_sendRequest_rdh | /**
* Sends the HTTP request. Note that HttpUrlConnection requires that an
* empty buffer be sent in order to set the "Content-Length: 0" header, which
* is required by our endpoint.
*
* @param buffer
* the request entity body.... | 3.26 |
hadoop_AbfsHttpOperation_isNullInputStream_rdh | /**
* Check null stream, this is to pass findbugs's redundant check for NULL
*
* @param stream
* InputStream
*/
private boolean isNullInputStream(InputStream stream) {
return stream == null ? true : false;
} | 3.26 |
hadoop_AbfsHttpOperation_toString_rdh | // Returns a trace message for the request
@Overridepublic String toString() {
final StringBuilder sb = new StringBuilder();
sb.append(statusCode);
sb.append(",");
sb.append(storageErrorCode);sb.append(",");
sb.append(expectedAppendPos);
sb.append(",cid=");sb.append(getClientRequestId());
sb... | 3.26 |
hadoop_AbfsHttpOperation_getConnRequestMethod_rdh | /**
* Gets the connection request method.
*
* @return request method.
*/
String getConnRequestMethod() {
return connection.getRequestMethod();} | 3.26 |
hadoop_AbfsHttpOperation_getConnUrl_rdh | /**
* Gets the connection url.
*
* @return url.
*/
URL getConnUrl() {
return connection.getURL();
} | 3.26 |
hadoop_AbfsHttpOperation_processResponse_rdh | /**
* Gets and processes the HTTP response.
*
* @param buffer
* a buffer to hold the response entity body
* @param offset
* an offset in the buffer where the data will being.
* @param length
* the number of bytes to be written to the ... | 3.26 |
hadoop_AbfsHttpOperation_openConnection_rdh | /**
* Open the HTTP connection.
*
* @throws IOException
* if an error occurs.
*/
private HttpURLConnection openConnection() throws IOException {
long start = System.nanoTime();
try {
return ((HttpURLConnection) (url.openConnection()));
} finally {
connectionTimeMs = elapsedTimeMs... | 3.26 |
hadoop_AbfsHttpOperation_getConnResponseCode_rdh | /**
* Gets the connection response code.
*
* @return response code.
* @throws IOException
*/
Integer getConnResponseCode() throws IOException {
return connection.getResponseCode();} | 3.26 |
hadoop_AbfsHttpOperation_getLogString_rdh | // Returns a trace message for the ABFS API logging service to consume
public String getLogString() {
final StringBuilder sb = new StringBuilder();
sb.append("s=").append(statusCode).append(" e=").append(storageErrorCode).append(" ci=").append(getClientRequestId()).append(" ri=").append(requestId).appen... | 3.26 |
hadoop_AbfsHttpOperation_getConnResponseMessage_rdh | /**
* Gets the connection response message.
*
* @return response message.
* @throws IOException
*/String getConnResponseMessage() throws IOException {
return connection.getResponseMessage();
} | 3.26 |
hadoop_AbfsHttpOperation_processStorageErrorResponse_rdh | /**
* When the request fails, this function is used to parse the responseAbfsHttpClient.LOG.debug("ExpectedError: ", ex);
* and extract the storageErrorCode and storageErrorMessage. Any errors
* encountered while attempting to process the error response are logged,
* but otherwise ignored.
*
* For storage errors... | 3.26 |
hadoop_AbfsHttpOperation_elapsedTimeMs_rdh | /**
* Returns the elapsed time in milliseconds.
*/
private long elapsedTimeMs(final long startTime) {
return (System.nanoTime() - startTime) / ONE_MILLION;
} | 3.26 |
hadoop_AbfsHttpOperation_getConnProperty_rdh | /**
* Gets the connection request property for a key.
*
* @param key
* The request property key.
* @return request peoperty value.
*/
String getConnProperty(String key) {
return connection.getRequestProperty(key);
} | 3.26 |
hadoop_AbfsHttpOperation_parseListFilesResponse_rdh | /**
* Parse the list file response
*
* @param stream
* InputStream contains the list results.
* @throws IOException
*/
private void parseListFilesResponse(final InputStream stream) throws IOException {
if (stream == null) {
return;
}
if (listResultSchema != null) {
// already parse ... | 3.26 |
hadoop_CleanerMetrics_reportCleaningStart_rdh | /**
* Report the start a new run of the cleaner.
*/
public void reportCleaningStart() {
processedFiles.set(0);
deletedFiles.set(0);
fileErrors.set(0);
} | 3.26 |
hadoop_CleanerMetrics_reportAFileProcess_rdh | /**
* Report a process operation at the current system time
*/
public void reportAFileProcess() {
totalProcessedFiles.incr();
processedFiles.incr();
} | 3.26 |
hadoop_CleanerMetrics_reportAFileDelete_rdh | /**
* Report a delete operation at the current system time
*/
public void reportAFileDelete() {
totalProcessedFiles.incr();
processedFiles.incr();
totalDeletedFiles.incr();
deletedFiles.incr();
} | 3.26 |
hadoop_CleanerMetrics_reportAFileError_rdh | /**
* Report a process operation error at the current system time
*/
public void reportAFileError() {
totalProcessedFiles.incr();
processedFiles.incr();
totalFileErrors.incr();
fileErrors.incr();
} | 3.26 |
hadoop_Tracer_getCurrentSpan_rdh | /**
* *
* Return active span.
*
* @return org.apache.hadoop.tracing.Span
*/
public static Span getCurrentSpan() {
return null;
} | 3.26 |
hadoop_Tracer_curThreadTracer_rdh | // Keeping this function at the moment for HTrace compatiblity,
// in fact all threads share a single global tracer for OpenTracing.
public static Tracer curThreadTracer() {
return globalTracer;
} | 3.26 |
hadoop_QueueAclsInfo_getOperations_rdh | /**
* Get opearations allowed on queue.
*
* @return array of String
*/
public String[] getOperations() {
return operations;
} | 3.26 |
hadoop_QueueAclsInfo_getQueueName_rdh | /**
* Get queue name.
*
* @return name
*/
public String getQueueName() {
return queueName;
} | 3.26 |
hadoop_IdentityMapper_map_rdh | /**
* The identity function. Input key/value pair is written directly to
* output.
*/
public void map(K key, V val, OutputCollector<K, V> output,
Reporter reporter) throws IOException {
output.collect(key, val);
} | 3.26 |
hadoop_AclUtil_getAclFromPermAndEntries_rdh | /**
* Given permissions and extended ACL entries, returns the full logical ACL.
*
* @param perm
* FsPermission containing permissions
* @param entries
* List<AclEntry> containing extended ACL entries
* @return List<AclEntry> containing full logical ACL
*/
... | 3.26 |
hadoop_AclUtil_isMinimalAcl_rdh | /**
* Checks if the given entries represent a minimal ACL (contains exactly 3
* entries).
*
* @param entries
* List<AclEntry> entries to check
* @return boolean true if the entries represent a minimal ACL
*/
public static boolean isMinimalAcl(List<AclEntry> entries) {
return entries.size() == 3;
} | 3.26 |
hadoop_FsCommand_getCommandName_rdh | // historical abstract method in Command
@Override
public String
getCommandName() {
return getName();
} | 3.26 |
hadoop_FsCommand_registerCommands_rdh | /**
* Register the command classes used by the fs subcommand
*
* @param factory
* where to register the class
*/
public static void registerCommands(CommandFactory factory) {
factory.registerCommands(AclCommands.class);
factory.registerCommands(CopyCommands.class);
facto... | 3.26 |
hadoop_FsCommand_runAll_rdh | /**
*
* @deprecated use {@link Command#run(String...argv)}
*/
@Deprecated
@Override
public int runAll() {
return run(args);
} | 3.26 |
hadoop_WebServlet_m0_rdh | /**
* Get method is modified to support impersonation and Kerberos
* SPNEGO token by forcing client side redirect when accessing
* "/" (root) of the web application context.
*/
@Override
protected void m0(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (reques... | 3.26 |
hadoop_AzureFileSystemInstrumentation_getBlockDownloadLatency_rdh | /**
* Get the current rolling average of the download latency.
*
* @return rolling average of download latency in milliseconds.
*/
public long getBlockDownloadLatency() {
return currentBlockDownloadLatency.getCurrentAverage();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_updateBytesWrittenInLastSecond_rdh | /**
* Sets the current gauge value for how many bytes were written in the last
* second.
*
* @param currentBytesWritten
* The number of bytes.
*/
public void updateBytesWrittenInLastSecond(long currentBytesWritten) {
bytesWrittenInLastSecond.set(currentBytesWritten);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_serverErrorEncountered_rdh | /**
* Indicate that we just encountered a server-caused error.
*/
public void serverErrorEncountered() {
serverErrors.incr();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_setContainerName_rdh | /**
* Sets the container name to tag all the metrics with.
*
* @param containerName
* The container name.
*/
public void setContainerName(String containerName) {
registry.tag("containerName", "Name of the Azure Storage container that these metrics are going against", containerName);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_setAccountName_rdh | /**
* Sets the account name to tag all the metrics with.
*
* @param accountName
* The account name.
*/
public void setAccountName(String accountName) {
registry.tag("accountName", "Name of the Azure Storage account that these metrics are going against", accountName);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getBlockUploadLatency_rdh | /**
* Get the current rolling average of the upload latency.
*
* @return rolling average of upload latency in milliseconds.
*/
public long getBlockUploadLatency() {
return currentBlockUploadLatency.getCurrentAverage();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getCurrentMaximumUploadBandwidth_rdh | /**
* Get the current maximum upload bandwidth.
*
* @return maximum upload bandwidth in bytes per second.
*/
public long getCurrentMaximumUploadBandwidth() {
return currentMaximumUploadBytesPerSecond;
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getMetricsRegistryInfo_rdh | /**
* Get the metrics registry information.
*
* @return The metrics registry information.
*/
public MetricsInfo getMetricsRegistryInfo() {
return registry.info();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_currentUploadBytesPerSecond_rdh | /**
* Record the current bytes-per-second upload rate seen.
*
* @param bytesPerSecond
* The bytes per second.
*/
public synchronized void currentUploadBytesPerSecond(long bytesPerSecond) {
if (bytesPerSecond > currentMaximumUploadBytesPerSecond) {
currentMaximumUploadBytesPerSecond = bytesPerSecond;
... | 3.26 |
hadoop_AzureFileSystemInstrumentation_clientErrorEncountered_rdh | /**
* Indicate that we just encountered a client-side error.
*/
public void clientErrorEncountered() {
clientErrors.incr();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_directoryDeleted_rdh | /**
* Indicate that we just deleted a directory through WASB.
*/
public void directoryDeleted() {
numberOfDirectoriesDeleted.incr();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_fileDeleted_rdh | /**
* Indicate that we just deleted a file through WASB.
*/
public void fileDeleted() {
numberOfFilesDeleted.incr();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_blockDownloaded_rdh | /**
* Indicate that we just downloaded a block and record its latency.
*
* @param latency
* The latency in milliseconds.
*/
public void blockDownloaded(long latency) {
currentBlockDownloadLatency.addPoint(latency);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_updateBytesReadInLastSecond_rdh | /**
* Sets the current gauge value for how many bytes were read in the last
* second.
*
* @param currentBytesRead
* The number of bytes.
*/
public void updateBytesReadInLastSecond(long currentBytesRead) {
bytesReadInLastSecond.set(currentBytesRead);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getFileSystemInstanceId_rdh | /**
* The unique identifier for this file system in the metrics.
*
* @return The unique identifier.
*/
public UUID getFileSystemInstanceId() {
return fileSystemInstanceId;
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getCurrentMaximumDownloadBandwidth_rdh | /**
* Get the current maximum download bandwidth.
*
* @return maximum download bandwidth in bytes per second.
*/
public long getCurrentMaximumDownloadBandwidth() {
return f0;
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_webResponse_rdh | /**
* Indicate that we just got a web response from Azure Storage. This should
* be called for every web request/response we do (to get accurate metrics
* of how we're hitting the storage service).
*/
public void webResponse() {
numberOfWebResponses.incr();
inMemoryNumberOfWebResponses.incrementAndGet();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_rawBytesDownloaded_rdh | /**
* Indicate that we just downloaded some data to Azure storage.
*
* @param numberOfBytes
* The raw number of bytes downloaded (including overhead).
*/
public void rawBytesDownloaded(long numberOfBytes) {
rawBytesDownloaded.incr(numberOfBytes);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_getCurrentWebResponses_rdh | /**
* Gets the current number of web responses obtained from Azure Storage.
*
* @return The number of web responses.
*/
public long getCurrentWebResponses() {
return inMemoryNumberOfWebResponses.get();
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_blockUploaded_rdh | /**
* Indicate that we just uploaded a block and record its latency.
*
* @param latency
* The latency in milliseconds.
*/
public void blockUploaded(long latency) {
currentBlockUploadLatency.addPoint(latency);
} | 3.26 |
hadoop_AzureFileSystemInstrumentation_rawBytesUploaded_rdh | /**
* Indicate that we just uploaded some data to Azure storage.
*
* @param numberOfBytes
* The raw number of bytes uploaded (including overhead).
*/
public void rawBytesUploaded(long numberOfBytes) {
rawBytesUploaded.incr(numberOfBytes);
} | 3.26 |
hadoop_MRJobConfUtil_redact_rdh | /**
* Redact job configuration properties.
*
* @param conf
* the job configuration to redact
*/
public static void redact(final Configuration conf) {
for (String prop : conf.getTrimmedStringCollection(MRJobConfig.MR_JOB_REDACTED_PROPERTIES)) {
conf.set(prop, REDACTION_REPLACEMENT_VAL);
}
} | 3.26 |
hadoop_MRJobConfUtil_m0_rdh | /**
* load the values defined from a configuration file including the delta
* progress and the maximum time between each log message.
*
* @param conf
*/
public static void m0(final Configuration conf) {
if (progressMinDeltaThreshold == null) {
progressMinDeltaThre... | 3.26 |
hadoop_MRJobConfUtil_setLocalDirectoriesConfigForTesting_rdh | /**
* Set local directories so that the generated folders is subdirectory of the
* test directories.
*
* @param conf
* @param testRootDir
* @return */
public static Configuration setLocalDirectoriesConfigForTesting(Configuration conf, File testRootDir) {
Configuration config = (conf == null) ? new Configurat... | 3.26 |
hadoop_MRJobConfUtil_getTaskProgressReportInterval_rdh | /**
* Get the progress heartbeat interval configuration for mapreduce tasks.
* By default, the value of progress heartbeat interval is a proportion of
* that of task timeout.
*
* @param conf
* the job configuration to read from
* @return the value of task progress report interval
*/
public static long getTask... | 3.26 |
hadoop_S3ACommitterFactory_chooseCommitterFactory_rdh | /**
* Choose a committer from the FS and task configurations. Task Configuration
* takes priority, allowing execution engines to dynamically change
* committer on a query-by-query basis.
*
* @param fileSystem
* FS
* @param outputPath
* destination path
* @param taskConf
* configuration from the task
* ... | 3.26 |
hadoop_S3ACommitterFactory_createTaskCommitter_rdh | /**
* Create a task committer.
*
* @param fileSystem
* destination FS.
* @param outputPath
* final output path for work
* @param context
* job context
* @return a committer
* @throws IOException
* instantiation failure
*/
@Override
public PathOutputCommitter createTaskCommitter(S3AFileSystem fileSys... | 3.26 |
hadoop_BlockStorageMovementCommand_getBlockPoolId_rdh | /**
* Returns block pool ID.
*/
public String getBlockPoolId() {
return blockPoolId;
} | 3.26 |
hadoop_BlockStorageMovementCommand_getBlockMovingTasks_rdh | /**
* Returns the list of blocks to be moved.
*/
public Collection<BlockMovingInfo> getBlockMovingTasks() {
return blockMovingTasks;
} | 3.26 |
hadoop_BinaryRecordOutput_get_rdh | /**
* Get a thread-local record output for the supplied DataOutput.
*
* @param out
* data output stream
* @return binary record output corresponding to the supplied DataOutput.
*/
public static BinaryRecordOutput get(DataOutput out) {
BinaryRecordOutput bout = B_OUT.get();
bout.m0(out);
return bout;... | 3.26 |
hadoop_RateLimitingFactory_create_rdh | /**
* Create an instance.
* If the rate is 0; return the unlimited rate.
*
* @param capacity
* capacity in permits/second.
* @return limiter restricted to the given capacity.
*/
public static RateLimiting create(int capacity) {
return capacity == 0 ? unlimitedRate() : new RestrictedRateLimiting(capacity);
... | 3.26 |
hadoop_RateLimitingFactory_unlimitedRate_rdh | /**
* Get the unlimited rate.
*
* @return a rate limiter which always has capacity.
*/
public static RateLimiting unlimitedRate() {
return UNLIMITED;
} | 3.26 |
hadoop_CommitUtils_getS3AFileSystem_rdh | /**
* Get the S3A FS of a path.
*
* @param path
* path to examine
* @param conf
* config
* @param magicCommitRequired
* is magic complete required in the FS?
* @return the filesystem
* @throws PathCommitException
* output path isn't to an S3A FS instance, or
* if {@code magicCommitRequired} is set... | 3.26 |
hadoop_CommitUtils_extractJobID_rdh | /**
* Extract the job ID from a configuration.
*
* @param conf
* configuration
* @return a job ID or null.
*/
public static String extractJobID(Configuration conf) {
String jobUUID = conf.getTrimmed(FS_S3A_COMMITTER_UUID, "");
if (!jobUUID.isEmpty()) {return jobUUID;
}
// there is no job UUID.
... | 3.26 |
hadoop_CommitUtils_verifyIsMagicCommitPath_rdh | /**
* Verify that the path is a magic one.
*
* @param fs
* filesystem
* @param path
* path
* @throws PathCommitException
* if the path isn't a magic commit path
*/
public static void verifyIsMagicCommitPath(S3AFileSystem fs, Path path) throws PathCommitException {
verifyIsMagicCommitFS(fs);
if (!... | 3.26 |
hadoop_CommitUtils_verifyIsMagicCommitFS_rdh | /**
* Verify that an S3A FS instance is a magic commit FS.
*
* @param fs
* filesystem
* @throws PathCommitException
* if the FS isn't a magic commit FS.
*/
public static void verifyIsMagicCommitFS(S3AFileSystem fs) throws PathCommitException {
if (!fs.isMagicCommitEnabled()) {
// dump out details... | 3.26 |
hadoop_CommitUtils_validateCollectionClass_rdh | /**
* Verify that all instances in a collection are of the given class.
*
* @param it
* iterator
* @param classname
* classname to require
* @throws ValidationFailure
* on a failure
*/
public static void validateCollectionClass(Iterable it, Class classname) throws ValidationFailure {
for (Object o : ... | 3.26 |
hadoop_CommitUtils_verifyIsS3AFS_rdh | /**
* Verify that an FS is an S3A FS.
*
* @param fs
* filesystem
* @param path
* path to to use in exception
* @return the typecast FS.
* @throws PathCommitException
* if the FS is not an S3A FS.
*/
public static S3AFileSystem verifyIsS3AFS(FileSystem fs, Path path) throws PathCommitException {
if (... | 3.26 |
hadoop_FSStarvedApps_take_rdh | /**
* Blocking call to fetch the next app to process. The returned app is
* tracked until the next call to this method. This tracking assumes a
* single reader.
*
* @return starved application to process
* @throws InterruptedException
* if interrupted while waiting
*/
FSAppAttempt take() throws InterruptedEx... | 3.26 |
hadoop_FSStarvedApps_addStarvedApp_rdh | /**
* Add a starved application if it is not already added.
*
* @param app
* application to add
*/
void addStarvedApp(FSAppAttempt app) {
if ((!app.equals(appBeingProcessed)) && (!appsToProcess.contains(app))) {
appsToProcess.add(app);
}
} | 3.26 |
hadoop_TextSplitter_bigDecimalToString_rdh | /**
* Return the string encoded in a BigDecimal.
* Repeatedly multiply the input value by 65536; the integer portion after such a multiplication
* represents a single character in base 65536. Convert that back into a char and create a
* string out of these until we have no data left.
*/
String bigDecimalToString(B... | 3.26 |
hadoop_TextSplitter_stringToBigDecimal_rdh | /**
* Return a BigDecimal representation of string 'str' suitable for use
* in a numerically-sorting order.
*/
BigDecimal stringToBigDecimal(String str) {
BigDecimal
result = BigDecimal.ZERO;
BigDecimal curPlace = ONE_PLACE;// start with 1/65536 to compute the first digit.
int len = Math.min(str.length(), MAX_CHARS... | 3.26 |
hadoop_TextSplitter_split_rdh | /**
* This method needs to determine the splits between two user-provided strings.
* In the case where the user's strings are 'A' and 'Z', this is not hard; we
* could create two splits from ['A', 'M') and ['M', 'Z'], 26 splits for strings
* beginning with each letter, etc.
*
* If a user has provided us with the ... | 3.26 |
hadoop_ReplicaAccessor_getNetworkDistance_rdh | /**
* Return the network distance between local machine and the remote machine.
*/
public int getNetworkDistance() {
return isLocal() ? 0 : Integer.MAX_VALUE;
} | 3.26 |
hadoop_DockerContainerDeletionTask_getContainerId_rdh | /**
* Get the id of the container to delete.
*
* @return the id of the container to delete.
*/
public String getContainerId() {
return
containerId;
} | 3.26 |
hadoop_DockerContainerDeletionTask_run_rdh | /**
* Delete the specified Docker container.
*/
@Overridepublic void run() {
LOG.debug("Running DeletionTask : {}", this);
LinuxContainerExecutor exec = ((LinuxContainerExecutor) (getDeletionService().getContainerExecutor()));
exec.removeDockerContainer(containerId);
} | 3.26 |
hadoop_DockerContainerDeletionTask_toString_rdh | /**
* Convert the DockerContainerDeletionTask to a String representation.
*
* @return String representation of the DockerContainerDeletionTask.
*/
@Override
public String toString() {
StringBuffer sb = new StringBuffer("DockerContainerDeletionTask : ");sb.append(" id : ").append(this.getTaskId());
sb.app... | 3.26 |
hadoop_MappableBlockLoader_verifyChecksum_rdh | /**
* Verifies the block's checksum. This is an I/O intensive operation.
*/
protected void verifyChecksum(long length, FileInputStream metaIn, FileChannel blockChannel, String blockFileName) throws IOException {
// Verify the checksum from the block's meta file
// Get the DataChecksum from the meta file he... | 3.26 |
hadoop_MappableBlockLoader_fillBuffer_rdh | /**
* Reads bytes into a buffer until EOF or the buffer's limit is reached.
*/
protected int fillBuffer(FileChannel channel, ByteBuffer buf) throws IOException {int bytesRead = channel.read(buf);
if (bytesRead < 0) {
// EOF
return bytesRead;
}
while (buf.remaining() > 0) {
int n ... | 3.26 |
hadoop_MappableBlockLoader_shutdown_rdh | /**
* Clean up cache, can be used during DataNode shutdown.
*/
void shutdown() {
// Do nothing.
} | 3.26 |
hadoop_StreamUtil_m0_rdh | /**
* It may seem strange to silently switch behaviour when a String
* is not a classname; the reason is simplified Usage:<pre>
* -mapper [classname | program ]
* instead of the explicit Usage:
* [-mapper program | -javamapper classname], -mapper and -javamapper are mutually exclusive.
* (repeat for -reducer, -co... | 3.26 |
hadoop_StreamUtil_findInClasspath_rdh | /**
*
* @return a jar file path or a base directory or null if not found.
*/
public static String findInClasspath(String className, ClassLoader loader) {
String relPath = className;
relPath = relPath.replace('.', '/');
relPath += ".class";
URL classUrl = loader.getResource(relPath);
String codePa... | 3.26 |
hadoop_Service_getValue_rdh | /**
* Get the integer value of a state
*
* @return the numeric value of the state
*/
public int getValue() {return value;
} | 3.26 |
hadoop_Service_toString_rdh | /**
* Get the name of a state
*
* @return the state's name
*/
@Override
public String toString() {
return statename;
} | 3.26 |
hadoop_AbfsClientThrottlingAnalyzer_addBytesTransferred_rdh | /**
* Updates metrics with results from the current storage operation.
*
* @param count
* The count of bytes transferred.
* @param isFailedOperation
* True if the operation failed; otherwise false.
*/
public void addBytesTransferred(long count, boolean isFailedOperation) {
AbfsOperationMetrics metrics =... | 3.26 |
hadoop_AbfsClientThrottlingAnalyzer_timerOrchestrator_rdh | /**
* Synchronized method to suspend or resume timer.
*
* @param timerFunctionality
* resume or suspend.
* @param timerTask
* The timertask object.
* @return true or false.
*/
private synchronized boolean timerOrchestrator(TimerFunctionality timerFunctionality, Time... | 3.26 |
hadoop_AbfsClientThrottlingAnalyzer_resumeTimer_rdh | /**
* Resumes the timer if it was stopped.
*/
private void resumeTimer() {
blobMetrics = new
AtomicReference<AbfsOperationMetrics>(new AbfsOperationMetrics(System.currentTimeMillis()));
timer.schedule(new TimerTaskImpl(), analysisPeriodMs, analysisPeriodMs);
isOperationOnAccountIdle.set(false);
} | 3.26 |
hadoop_AbfsClientThrottlingAnalyzer_run_rdh | /**
* Periodically analyzes a snapshot of the blob storage metrics and updates
* the sleepDuration in order to appropriately throttle storage operations.
*/
@Override
public void run() {
boolean doWork = false;
try {
doWork =
doingWork.compareAndSet(0, 1);
// prevent concurrent execut... | 3.26 |
hadoop_JobACLsManager_constructJobACLs_rdh | /**
* Construct the jobACLs from the configuration so that they can be kept in
* the memory. If authorization is disabled on the JT, nothing is constructed
* and an empty map is returned.
*
* @return JobACL to AccessControlList map.
*/
public Map<JobACL, AccessControlList> constructJobACLs(Configuration conf) {
... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.