name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_BondedS3AStatisticsContext_newDelegationTokenStatistics_rdh | /**
* Create a delegation token statistics instance.
*
* @return an instance of delegation token statistics
*/
@Override
public DelegationTokenStatistics newDelegationTokenStatistics() {
return getInstrumentation().newDelegationTokenStatistics();
} | 3.26 |
hadoop_BondedS3AStatisticsContext_newOutputStreamStatistics_rdh | /**
* Create a stream output statistics instance.
*
* @return the new instance
*/
@Override
public BlockOutputStreamStatistics newOutputStreamStatistics() {
return getInstrumentation().newOutputStreamStatistics(getInstanceStatistics());
} | 3.26 |
hadoop_BondedS3AStatisticsContext_addValueToQuantiles_rdh | /**
* Add a value to a quantiles statistic. No-op if the quantile
* isn't found.
*
* @param op
* operation to look up.
* @param value
* value to add.
* @throws ClassCastException
* if the metric is not a Quantiles.
*/
@Override
public void addValueToQuantiles(Statistic op, long value) {
getInstrumen... | 3.26 |
hadoop_BondedS3AStatisticsContext_incrementGauge_rdh | /**
* Increment a specific gauge.
* <p>
* No-op if not defined.
*
* @param op
* operation
* @param count
* increment value
* @throws ClassCastException
* if the metric is of the wrong type
*/
@Override
public void incrementGauge(Statistic op, long count) {
getInstrumentation().incrementGauge(op, c... | 3.26 |
hadoop_BondedS3AStatisticsContext_incrementCounter_rdh | /**
* Increment a specific counter.
* <p>
* No-op if not defined.
*
* @param op
* operation
* @param count
* increment value
*/
@Override
public void incrementCounter(Statistic op, long count) {
getInstrumentation().incrementCounter(op, count);
} | 3.26 |
hadoop_BondedS3AStatisticsContext_getInstanceStatistics_rdh | /**
* The filesystem statistics: know this is thread-local.
*
* @return FS statistics.
*/
private Statistics getInstanceStatistics() {
return statisticsSource.getInstanceStatistics();} | 3.26 |
hadoop_BondedS3AStatisticsContext_getInstrumentation_rdh | /**
* Get the instrumentation from the FS integration.
*
* @return instrumentation instance.
*/
private S3AInstrumentation getInstrumentation() {
return statisticsSource.getInstrumentation();
} | 3.26 |
hadoop_BondedS3AStatisticsContext_newInputStreamStatistics_rdh | /**
* Create a stream input statistics instance.
* The FileSystem.Statistics instance of the {@link #statisticsSource}
* is used as the reference to FileSystem statistics to update
*
* @return the new instance
*/
@Override
public S3AInputStreamStatistics newInputStreamStatistics() {
return getInstrumentation(... | 3.26 |
hadoop_OperationAuditorOptions_withConfiguration_rdh | /**
* Set builder value.
*
* @param value
* new value
* @return the builder
*/
public OperationAuditorOptions withConfiguration(final Configuration value) {
configuration = value;
return this;
} | 3.26 |
hadoop_OperationAuditorOptions_m0_rdh | /**
* Create one.
*
* @return a new option instance
*/
public static OperationAuditorOptions m0() {
return new OperationAuditorOptions();
} | 3.26 |
hadoop_OperationAuditorOptions_withIoStatisticsStore_rdh | /**
* Set builder value.
*
* @param value
* new value
* @return the builder
*/
public OperationAuditorOptions withIoStatisticsStore(final IOStatisticsStore value) {
ioStatisticsStore = value;
return this;
} | 3.26 |
hadoop_AuditContextUpdater_resetCurrentAuditContext_rdh | /**
* Remove job/task info from the current audit context.
*/
public void resetCurrentAuditContext() {
currentAuditContext().remove(AuditConstants.PARAM_JOB_ID);currentAuditContext().remove(CommitConstants.PARAM_TASK_ATTEMPT_ID);
} | 3.26 |
hadoop_AuditContextUpdater_updateCurrentAuditContext_rdh | /**
* Add job/task info to current audit context.
*/
public void updateCurrentAuditContext() {
final CommonAuditContext auditCtx = currentAuditContext();
if (jobId != null) {
auditCtx.put(AuditConstants.PARAM_JOB_ID, jobId);
} else {
currentAuditContext().remove(AuditConstants.PARAM_JOB_ID... | 3.26 |
hadoop_DockerClientConfigHandler_getCredentialsFromTokensByteBuffer_rdh | /**
* Convert the Token ByteBuffer to the appropriate Credentials object.
*
* @param tokens
* the Tokens from the ContainerLaunchContext.
* @return the Credentials object populated from the Tokens.
* @throws IOException
* io error occur.
*/
public static Credentials getCredentialsFromTokensByteBuffer(ByteBu... | 3.26 |
hadoop_DockerClientConfigHandler_readCredentialsFromConfigFile_rdh | /**
* Read the Docker client configuration and extract the auth tokens into
* Credentials.
*
* @param configFile
* the Path to the Docker client configuration.
* @param conf
* the Configuration object, needed by the FileSystem.
* @param applicationId
* the application ID to associate the Credentials with... | 3.26 |
hadoop_DockerClientConfigHandler_writeDockerCredentialsToPath_rdh | /**
* Extract the Docker related tokens from the Credentials and write the Docker
* client configuration to the supplied File.
*
* @param outConfigFile
* the File to write the Docker client configuration to.
* @param credentials
* the populated Credentials object.
* @throws IOException
* if the write fai... | 3.26 |
hadoop_AllocationTags_getNamespace_rdh | /**
*
* @return the namespace of these tags.
*/
public TargetApplicationsNamespace getNamespace() {
return this.ns;
} | 3.26 |
hadoop_AllocationTags_getTags_rdh | /**
*
* @return the allocation tags.
*/
public Set<String> getTags() {
return
this.tags;
} | 3.26 |
hadoop_AdlFsInputStream_available_rdh | /**
* This method returns the remaining bytes in the stream, rather than the
* expected Java
* interpretation of {@link java.io.InputStream#available()}, which expects
* the
* number of remaining
* bytes in the local buffer. Moreover, it caps the value returned to a
* maximum of Integer.MAX_VALUE.
* These chang... | 3.26 |
hadoop_AdlFsInputStream_getPos_rdh | /**
* Return the current offset from the start of the file.
*/
@Override
public synchronized long getPos() throws IOException {
return f0.getPos();
} | 3.26 |
hadoop_RollingFileSystemSink_rollLogDirIfNeeded_rdh | /**
* Check the current directory against the time stamp. If they're not
* the same, create a new directory and a new log file in that directory.
*
* @throws MetricsException
* thrown if an error occurs while creating the
* new directory or new log file
*/
private void rollLogDirIfNeeded() throws MetricsExc... | 3.26 |
hadoop_RollingFileSystemSink_m0_rdh | /**
* Set the {@link #nextFlush} variable to the initial flush time. The initial
* flush will be an integer number of flush intervals past the beginning of
* the current hour and will have a random offset added, up to
* {@link #rollOffsetIntervalMillis}. The initial flush will be a time in
* past that can be used ... | 3.26 |
hadoop_RollingFileSystemSink_createOrAppendLogFile_rdh | /**
* Create a new log file and return the {@link FSDataOutputStream}. If a
* file with the specified path already exists, open the file for append
* instead.
*
* Once the file is open, update {@link #currentFSOutStream},
* {@link #currentOutStream}, and {@#link #currentFilePath}.
*
* @param initial
* the ta... | 3.26 |
hadoop_RollingFileSystemSink_getNonNegative_rdh | /**
* Return the property value if it's non-negative and throw an exception if
* it's not.
*
* @param key
* the property key
* @param defaultValue
* the default value
*/ private long getNonNegative(String key, int defaultValue) {
int flushOffsetIntervalMillis = properties.getInt(key, defaultValue);
... | 3.26 |
hadoop_RollingFileSystemSink_rollLogDir_rdh | /**
* Create a new directory based on the current interval and a new log file in
* that directory.
*
* @throws IOException
* thrown if an error occurs while creating the
* new directory or new log file
*/private void rollLogDir() throws IOException {
String fileName = ((source + "-") + InetAddress.getLoc... | 3.26 |
hadoop_RollingFileSystemSink_stringifySecurityProperty_rdh | /**
* Turn a security property into a nicely formatted set of <i>name=value</i>
* strings, allowing for either the property or the configuration not to be
* set.
*
* @param property
* the property to stringify
* @return the stringified property
*/
private String stringifySecurityProperty(String property) {Str... | 3.26 |
hadoop_RollingFileSystemSink_m1_rdh | /**
* If the sink isn't set to ignore errors, throw a {@link MetricsException}
* if the stream encountered an exception. The message parameter will be used
* as the new exception's message with the current file name
* ({@link #currentFilePath}) appended to it.
*
* @param message
* the exception message. The m... | 3.26 |
hadoop_RollingFileSystemSink_getRollInterval_rdh | /**
* Extract the roll interval from the configuration and return it in
* milliseconds.
*
* @return the roll interval in millis
*/
@VisibleForTesting
protected long getRollInterval() {
String rollInterval = properties.getString(ROLL_INTERVAL_KEY, DEFAULT_ROLL_INTERVAL);
Pattern pattern = Pattern.compile("^... | 3.26 |
hadoop_RollingFileSystemSink_checkAppend_rdh | /**
* Test whether the file system supports append and return the answer.
*
* @param fs
* the target file system
*/
private boolean checkAppend(FileSystem fs) {
boolean canAppend = true;
try {
fs.append(basePath);
... | 3.26 |
hadoop_RollingFileSystemSink_scheduleFlush_rdh | /**
* Schedule the current interval's directory to be flushed. If this ends up
* running after the top of the next interval, it will execute immediately.
*
* @param when
* the time the thread should run
*/
private void scheduleFlush(Date when) {
// Store the current currentDirPath to close later
final P... | 3.26 |
hadoop_RollingFileSystemSink_createLogFile_rdh | /**
* Create a new log file and return the {@link FSDataOutputStream}. If a
* file with the specified path already exists, add a suffix, starting with 1
* and try again. Keep incrementing the suffix until a nonexistent target
* path is found.
*
* Once the file is open, update {@link #currentFSOutStream},
* {@lin... | 3.26 |
hadoop_RollingFileSystemSink_checkIfPropertyExists_rdh | /**
* Throw a {@link MetricsException} if the given property is not set.
*
* @param key
* the key to validate
*/
private void checkIfPropertyExists(String key) {
if (!properties.containsKey(key)) {
throw new MetricsException(("Metrics2 configuration is missing " + key) + " property");
}
... | 3.26 |
hadoop_RollingFileSystemSink_updateFlushTime_rdh | /**
* Update the {@link #nextFlush} variable to the next flush time. Add
* an integer number of flush intervals, preserving the initial random offset.
*
* @param now
* the current time
*/
@VisibleForTesting
protected void updateFlushTime(Date now) {
// In non-initial rounds, add an integer number of interv... | 3.26 |
hadoop_RollingFileSystemSink_throwMetricsException_rdh | /**
* If the sink isn't set to ignore errors, throw a new
* {@link MetricsException}. The message parameter will be used as the
* new exception's message with the current file name
* ({@link #currentFilePath}) appended to it.
*
* @param message
* the exception message. The message will have a colon and
* ... | 3.26 |
hadoop_RollingFileSystemSink_getNextIdToTry_rdh | /**
* Return the next ID suffix to use when creating the log file. This method
* will look at the files in the directory, find the one with the highest
* ID suffix, and 1 to that suffix, and return it. This approach saves a full
* linear probe, which matters in the case where... | 3.26 |
hadoop_RollingFileSystemSink_findCurrentDirectory_rdh | /**
* Use the given time to determine the current directory. The current
* directory will be based on the {@link #rollIntervalMinutes}.
*
* @param now
* the current time
* @return the current directory
*/
private Path findCurrentDirector... | 3.26 |
hadoop_RollingFileSystemSink_getFileSystem_rdh | /**
* Return the supplied file system for testing or otherwise get a new file
* system.
*
* @return the file system to use
* @throws MetricsException
* thrown if the file system could not be retrieved
*/
... | 3.26 |
hadoop_RollingFileSystemSink_extractId_rdh | /**
* Extract the ID from the suffix of the given file name.
*
* @param file
* the file name
* @return the ID or -1 if no ID could be extracted
*/
private int extractId(String file) {
int index = file.lastIndexOf(".");
int id = -1;
// A hostname has to have at least ... | 3.26 |
hadoop_RollingFileSystemSink_initFs_rdh | /**
* Initialize the connection to HDFS and create the base directory. Also
* launch the flush thread.
*/
private boolean initFs() {
boolean success = false;
fileSystem = getFileSystem();
// This step isn't strictly necessary, but it makes debugging issues much
// easier. We try to create the base directory eage... | 3.26 |
hadoop_RollingFileSystemSink_loadConf_rdh | /**
* Return the supplied configuration for testing or otherwise load a new
* configuration.
*
* @return the configuration to use
*/
private Configuration loadConf() { Configuration c;
if (suppliedConf != null) {
c = suppliedConf;
} else {
// The config we're handed in init() isn't the on... | 3.26 |
hadoop_ContainerLogContext_getExitCode_rdh | /**
* Get the exit code of the container.
*
* @return the exit code
*/
public int getExitCode() {
return exitCode;
} | 3.26 |
hadoop_ContainerLogContext_getContainerType_rdh | /**
* Get {@link ContainerType} the type of the container.
*
* @return the type of the container
*/
public ContainerType getContainerType() {
return f0;
} | 3.26 |
hadoop_ContainerLogContext_m0_rdh | /**
* Get {@link ContainerId} of the container.
*
* @return the container ID
*/
public ContainerId m0() {
return containerId;} | 3.26 |
hadoop_NamenodeHeartbeatResponse_newInstance_rdh | /**
* API response for registering a namenode with the state store.
*/public abstract class NamenodeHeartbeatResponse {
public static NamenodeHeartbeatResponse newInstance() throws IOException {
return StateStoreSerializer.newRecord(NamenodeHeartbeatResponse.class);
} | 3.26 |
hadoop_CallableSupplier_submit_rdh | /**
* Submit a callable into a completable future.
* RTEs are rethrown.
* Non RTEs are caught and wrapped; IOExceptions to
* {@code RuntimeIOException} instances.
*
* @param executor
* executor.
* @param auditSpan
* audit span (or null)
* @param call
* call to invoke
* @param <T>
* type
* @return ... | 3.26 |
hadoop_CallableSupplier_waitForCompletionIgnoringExceptions_rdh | /**
* Wait for a single of future to complete, ignoring exceptions raised.
*
* @param future
* future to wait for.
* @param <T>
* type
* @return the outcome if successfully retrieved.
*/
public static <T> Optional<T> waitForCompletionIgnoringExceptions(@Nullable
final CompletableFuture<T> future) {
tr... | 3.26 |
hadoop_CallableSupplier_get_rdh | /**
* Active any span and then call the supplied callable.
*
* @return the result.
*/
@Override
public T get() {
try {
if (auditSpan != null) {
auditSpan.activate();
}
return call.call();
} catch (RuntimeException e) {
throw e;
} catch (IOException e) {
... | 3.26 |
hadoop_CallableSupplier_waitForCompletion_rdh | /**
* Wait for a single of future to complete, extracting IOEs afterwards.
*
* @param future
* future to wait for.
* @param <T>
* type
* @return the result
* @throws IOException
* if one of the called futures raised an IOE.
* @throws RuntimeException
* if one of the futures raised one.
*/
public sta... | 3.26 |
hadoop_XAttrStorage_readINodeXAttrs_rdh | /**
* Reads the existing extended attributes of an inode.
* <p>
* Must be called while holding the FSDirectory read lock.
*
* @param inodeAttr
* INodeAttributes to read.
* @return {@code XAttr} list.
*/
public static List<XAttr> readINodeXAttrs(INodeAttributes inodeAttr) {
XAttrFeature
f = inodeAttr.getXAttrF... | 3.26 |
hadoop_XAttrStorage_updateINodeXAttrs_rdh | /**
* Update xattrs of inode.
* <p>
* Must be called while holding the FSDirectory write lock.
*
* @param inode
* INode to update
* @param xAttrs
* to update xAttrs.
* @param snapshotId
* id of the latest snapshot of the inode
*/
public static void updateINodeXAttrs(INode inode, List<XAttr> xAttrs, int... | 3.26 |
hadoop_XAttrStorage_readINodeXAttrByPrefixedName_rdh | /**
* Reads the extended attribute of an inode by name with prefix.
* <p>
*
* @param inode
* INode to read
* @param snapshotId
* the snapshotId of the requested path
* @param prefixedName
* xAttr name with prefix
* @return the xAttr
*/public static XAttr readINodeXAttrByPrefixedName(INode inode, int ... | 3.26 |
hadoop_S3ARemoteObject_getPath_rdh | /**
* Gets the path corresponding to the given s3Attributes.
*
* @param s3Attributes
* attributes of an S3 object.
* @return the path corresponding to the given s3Attributes.
*/
public static String getPath(S3ObjectAttributes s3Attributes) {
return String.format("s3a://%s/%s", s3Attributes.getBucket(), s3At... | 3.26 |
hadoop_S3ARemoteObject_getStatistics_rdh | /**
* Gets an instance of {@code S3AInputStreamStatistics} used for reporting access metrics.
*
* @return an instance of {@code S3AInputStreamStatistics} used for reporting access metrics.
*/
public S3AInputStreamStatistics getStatistics() {
return streamStatistics;
} | 3.26 |
hadoop_S3ARemoteObject_openForRead_rdh | /**
* Opens a section of the file for reading.
*
* @param offset
* Start offset (0 based) of the section to read.
* @param size
* Size of the section to read.
* @return an {@code InputStream} corresponding to the given section of this file.
* @throws IOException
* if there is an error opening this file s... | 3.26 |
hadoop_S3ARemoteObject_getReadInvoker_rdh | /**
* Gets an instance of {@code Invoker} for interacting with S3 API.
*
* @return an instance of {@code Invoker} for interacting with S3 API.
*/
public Invoker getReadInvoker() {
return context.getReadInvoker();
} | 3.26 |
hadoop_S3ARemoteObject_size_rdh | /**
* Gets the size of this file.
* Its value is cached once obtained from AWS.
*
* @return the size of this file.
*/
public long size() {
return s3Attributes.getLen();
} | 3.26 |
hadoop_HdfsDataInputStream_getCurrentDatanode_rdh | /**
* Get the datanode from which the stream is currently reading.
*/
public DatanodeInfo getCurrentDatanode() {
return m0().getCurrentDatanode();
} | 3.26 |
hadoop_HdfsDataInputStream_m1_rdh | /**
* Get the collection of blocks that has already been located.
*/
public List<LocatedBlock> m1() throws IOException {
return m0().getAllBlocks();
} | 3.26 |
hadoop_HdfsDataInputStream_getWrappedStream_rdh | /**
* Get a reference to the wrapped output stream. We always want to return the
* actual underlying InputStream, even when we're using a CryptoStream. e.g.
* in the delegated methods below.
*
* @return the underlying output stream
*/
public InputStream getWrappedStream() {
return in;
} | 3.26 |
hadoop_HdfsDataInputStream_getCurrentBlock_rdh | /**
* Get the block containing the target position.
*/
public ExtendedBlock getCurrentBlock() {
return m0().getCurrentBlock();
} | 3.26 |
hadoop_HdfsDataInputStream_getReadStatistics_rdh | /**
* Get statistics about the reads which this DFSInputStream has done.
* Note that because HdfsDataInputStream is buffered, these stats may
* be higher than you would expect just by adding up the number of
* bytes read through HdfsDataInputStream.
*/
public ReadStatistics getReadStatistics() {
return m0().ge... | 3.26 |
hadoop_HdfsDataInputStream_getVisibleLength_rdh | /**
* Get the visible length of the file. It will include the length of the last
* block even if that is in UnderConstruction state.
*
* @return The visible length of the file.
*/ public long
getVisibleLength() {
return m0().getFileLength();
} | 3.26 |
hadoop_RawErasureEncoder_encode_rdh | /**
* Encode with inputs and generates outputs. More see above.
*
* @param inputs
* input buffers to read data from
* @param outputs
* output buffers to put the encoded data into, read to read
* after the call
* @throws IOException
* if the encoder is closed.
*/
public void encode(ECChunk[] inputs, EC... | 3.26 |
hadoop_RawErasureEncoder_release_rdh | /**
* Should be called when release this coder. Good chance to release encoding
* or decoding buffers
*/
public void release() {
// Nothing to do here.
} | 3.26 |
hadoop_RawErasureEncoder_allowVerboseDump_rdh | /**
* Allow to dump verbose info during encoding/decoding.
*
* @return true if it's allowed to do verbose dump, false otherwise.
*/
public boolean
allowVerboseDump() {
return coderOptions.allowVerboseDump();
} | 3.26 |
hadoop_RawErasureEncoder_allowChangeInputs_rdh | /**
* Allow change into input buffers or not while perform encoding/decoding.
*
* @return true if it's allowed to change inputs, false otherwise
*/public boolean allowChangeInputs() {
return coderOptions.allowChangeInputs();
} | 3.26 |
hadoop_HadoopExecutors_shutdown_rdh | /**
* Helper routine to shutdown a {@link ExecutorService}. Will wait up to a
* certain timeout for the ExecutorService to gracefully shutdown. If the
* ExecutorService did not shutdown and there are still tasks unfinished after
* the timeout period, the ExecutorService will be notified to forcibly shut
* down. An... | 3.26 |
hadoop_HadoopExecutors_newSingleThreadExecutor_rdh | // Executors.newSingleThreadExecutor has special semantics - for the
// moment we'll delegate to it rather than implement the semantics here.
public static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory) {
return Executors.newSingleThreadExecutor(threadFactory);
} | 3.26 |
hadoop_HadoopExecutors_m0_rdh | // Executors.newSingleThreadScheduledExecutor has special semantics - for the
// moment we'll delegate to it rather than implement the semantics here
public static ScheduledExecutorService m0() {
return Executors.newSingleThreadScheduledExecutor();
} | 3.26 |
hadoop_InterruptEscalator_register_rdh | /**
* Register an interrupt handler.
*
* @param signalName
* signal name
* @throws IllegalArgumentException
* if the registration failed
*/
public synchronized void register(String signalName) {
IrqHandler handler = new IrqHandler(signalName, this);
handler.bind();
interruptHandlers.add(handler);
} | 3.26 |
hadoop_InterruptEscalator_lookup_rdh | /**
* Look up the handler for a signal.
*
* @param signalName
* signal name
* @return a handler if found
*/
public synchronized IrqHandler lookup(String signalName) {
for (IrqHandler irqHandler : interruptHandlers) {
if (irqHandler.getName().equals(signalName)) {
return irqHandler;
}
}
return null;
} | 3.26 |
hadoop_InterruptEscalator_run_rdh | /**
* Shutdown callback: stop the service and set an atomic boolean
* if it stopped within the shutdown time.
*/
@Override
public void run() {
if (service
!= null) {
service.stop();
f0.set(service.waitForServiceToStop(shutdownTimeMillis));
} else {
f0.set(true);
}
} | 3.26 |
hadoop_InterruptEscalator_isSignalAlreadyReceived_rdh | /**
* Flag set if a signal has been received.
*
* @return true if there has been one interrupt already.
*/public boolean isSignalAlreadyReceived() {
return signalAlreadyReceived.get();
} | 3.26 |
hadoop_InterruptEscalator_getServiceWasShutdown_rdh | /**
* Probe for the service being shutdown.
*
* @return true if the service has been shutdown in the runnable
*/
private boolean getServiceWasShutdown() {
return f0.get();
} | 3.26 |
hadoop_InterruptEscalator_isForcedShutdownTimedOut_rdh | /**
* Flag set if forced shut down timed out.
*
* @return true if a shutdown was attempted and it timed out
*/
public boolean isForcedShutdownTimedOut() {
return forcedShutdownTimedOut;
} | 3.26 |
hadoop_AssumedRoleCredentialProvider_close_rdh | /**
* Propagate the close() call to the inner stsProvider.
*/
@Override
public void close() {
S3AUtils.closeAutocloseables(LOG, stsProvider, credentialsToSTS, stsClient);
} | 3.26 |
hadoop_AssumedRoleCredentialProvider_sanitize_rdh | /**
* Build a session name from the string, sanitizing it for the permitted
* characters.
*
* @param session
* source session
* @return a string for use in role requests.
*/
@VisibleForTesting
static String sanitize(String session) {
StringBuilder r = new StringBuilder(session.length());
for (char c : ... | 3.26 |
hadoop_AssumedRoleCredentialProvider_resolveCredentials_rdh | /**
* Get credentials.
*
* @return the credentials
* @throws StsException
* if none could be obtained.
*/
@Override
@Retries.RetryRaw
public AwsCredentials resolveCredentials() {
try {
return invoker.retryUntranslated("resolveCredentials", true, stsProvider::resolveCredentials);
} catch (IOExcep... | 3.26 |
hadoop_AssumedRoleCredentialProvider_operationRetried_rdh | /**
* Callback from {@link Invoker} when an operation is retried.
*
* @param text
* text of the operation
* @param ex
* exception
* @param retries
* number of retries
* @param idempotent
* is the method idempotent
*/
public void operationRetried(String text, Exception ex, int retries,
boolean idempot... | 3.26 |
hadoop_AssumedRoleCredentialProvider_buildSessionName_rdh | /**
* Build the session name from the current user's shortname.
*
* @return a string for the session name.
* @throws IOException
* failure to get the current user
*/
static String buildSessionName() throws IOException
{
return sanitize(UserGroupInformation.getCurrentUser().getShortUserName());
} | 3.26 |
hadoop_FileSetUtils_getCommaSeparatedList_rdh | /**
* Returns a string containing every element of the given list, with each
* element separated by a comma.
*
* @param list
* List of all elements
* @return String containing every element, comma-separated
*/
private static String getCommaSeparatedList(List<String> list)
{
StringBuilder buffer = new Stri... | 3.26 |
hadoop_FileSetUtils_convertFileSetToFiles_rdh | /**
* Converts a Maven FileSet to a list of File objects.
*
* @param source
* FileSet to convert
* @return List containing every element of the FileSet as a File
* @throws IOException
* if an I/O error occurs while trying to find the files
*/@SuppressWarnings("unchecked")
public static List<File> convertFi... | 3.26 |
hadoop_RouterAuditLogger_createStringBuilderForSuccessEvent_rdh | /**
* A helper function for creating the common portion of a successful
* log message.
*/
private static StringBuilder createStringBuilderForSuccessEvent(String user, String operation, String target) {
StringBuilder b = new StringBuilder();
start(Keys.USER, user, b);
addRemoteIP(b);
add(Keys.OPERATION, operation, ... | 3.26 |
hadoop_RouterAuditLogger_addRemoteIP_rdh | /**
* A helper api to add remote IP address.
*/
static void addRemoteIP(StringBuilder b) {
InetAddress ip = Server.getRemoteIp();
// ip address can be null for testcases
if (ip != null) {
add(Keys.IP, ip.getHostAddress(), b);
}
} | 3.26 |
hadoop_RouterAuditLogger_createSuccessLog_rdh | /**
* A helper api for creating an audit log for a successful event.
*/
static String createSuccessLog(String user, String operation, String target, ApplicationId appId, SubClusterId subClusterID) {
StringBuilder b = createStringBuilderForSuccessEvent(user, operation, target); if (appId != null) {
add(Keys.APPID... | 3.26 |
hadoop_RouterAuditLogger_logFailure_rdh | /**
* Create a readable and parsable audit log string for a failed event.
*
* @param user
* User who made the service request.
* @param operation
* Operation requested by the user.
* @param perm
* Target permissions.
* @param target
* The target on which the operation is being performed.
* @param des... | 3.26 |
hadoop_RouterAuditLogger_m0_rdh | /**
* A helper function for creating the common portion of a failure
* log message.
*/
private static StringBuilder m0(String user, String operation, String target, String description, String perm) {
StringBuilder b = new StringBuilder();
start(Keys.USER, user, b);
addRemoteIP(b);
add(Keys.OPERATION, operation, b... | 3.26 |
hadoop_RouterAuditLogger_logSuccess_rdh | /**
* Create a readable and parseable audit log string for a successful event.
*
* @param user
* User who made the service request to the Router
* @param operation
* Operation requested by the user.
* @param target
* The target on which the operation is being performed.
* @param appId
* Application Id... | 3.26 |
hadoop_RouterAuditLogger_start_rdh | /**
* Adds the first key-val pair to the passed builder in the following format
* key=value.
*/static void start(Keys key, String value, StringBuilder b) {
b.append(key.name()).append(AuditConstants.KEY_VAL_SEPARATOR).append(value);
} | 3.26 |
hadoop_RouterAuditLogger_createFailureLog_rdh | /**
* A helper api for creating an audit log for a failure event.
*/
static String createFailureLog(String user, String operation, String perm, String target, String description, ApplicationId appId, SubClusterId subClusterId) {
StringBuilder b = m0(user, operation, target, description, perm); if (appId != null) {
... | 3.26 |
hadoop_RouterAuditLogger_add_rdh | /**
* Appends the key-val pair to the passed builder in the following format
* <pair-delim>key=value.
*/
static void add(Keys key, String value, StringBuilder b) {
b.append(AuditConstants.f1).append(key.name()).append(AuditConstants.KEY_VAL_SEPARATOR).append(value);
} | 3.26 |
hadoop_AbstractReservationSystem_getPlanFollowerTimeStep_rdh | /**
*
* @return the planStepSize
*/
@Override
public long getPlanFollowerTimeStep() {
readLock.lock();
try {
return planStepSize;
} finally {
readLock.unlock();
}
} | 3.26 |
hadoop_AbstractReservationSystem_getDefaultReservationSystem_rdh | /**
* Get the default reservation system corresponding to the scheduler
*
* @param scheduler
* the scheduler for which the reservation system is required
* @return the {@link ReservationSystem} based on the configured scheduler
*/
public static String getDefaultReservationSystem(ResourceScheduler scheduler) {
i... | 3.26 |
hadoop_RpcNoSuchMethodException_getRpcErrorCodeProto_rdh | /**
* get the detailed rpc status corresponding to this exception
*/
public RpcErrorCodeProto getRpcErrorCodeProto() {
return RpcErrorCodeProto.ERROR_NO_SUCH_METHOD;
} | 3.26 |
hadoop_RpcNoSuchMethodException_getRpcStatusProto_rdh | /**
* get the rpc status corresponding to this exception
*/
public RpcStatusProto getRpcStatusProto() {
return RpcStatusProto.ERROR;
} | 3.26 |
hadoop_ByteArrayEncodingState_convertToByteBufferState_rdh | /**
* Convert to a ByteBufferEncodingState when it's backed by on-heap arrays.
*/
ByteBufferEncodingState convertToByteBufferState() {
ByteBuffer[] newInputs = new ByteBuffer[f0.length];
ByteBuffer[] newOutputs = new ByteBuffer[outputs.length];
for (int i = 0; i < f0.length; i++) {
newInputs[i] = ... | 3.26 |
hadoop_ByteArrayEncodingState_checkBuffers_rdh | /**
* Check and ensure the buffers are of the desired length.
*
* @param buffers
* the buffers to check
*/
void checkBuffers(byte[][] buffers) {
for (byte[] buffer : buffers) {
if (buffer == null) {
throw new HadoopIllegalArgumentException("Invalid buffer found, not allowing null");
... | 3.26 |
hadoop_And_apply_rdh | /**
* Applies child expressions to the {@link PathData} item. If all pass then
* returns {@link Result#PASS} else returns the result of the first
* non-passing expression.
*/
@Override
public Result apply(PathData item, int depth) throws IOException {
Result result = Result.PASS;
for (Expression child : get... | 3.26 |
hadoop_And_registerExpression_rdh | /**
* Registers this expression with the specified factory.
*/
public static void registerExpression(ExpressionFactory factory) throws IOException {
factory.addClass(And.class, "-a");
factory.addClass(And.class, "-and");
} | 3.26 |
hadoop_AbstractDTService_requireServiceStarted_rdh | /**
* Require the service to be started.
*
* @throws IllegalStateException
* if it is not.
*/
protected void requireServiceStarted() throws IllegalStateException {
requireServiceState(STATE.STARTED);
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.