name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_JobACLsManager_isMRAdmin_rdh | /**
* Is the calling user an admin for the mapreduce cluster
* i.e. member of mapreduce.cluster.administrators
*
* @return true, if user is an admin
*/
boolean isMRAdmin(UserGroupInformation callerUGI) {
if (adminAcl.isUserAllowed(callerUGI)) {
return true;
}
return false;
... | 3.26 |
hadoop_ResourceCalculator_compare_rdh | /**
* On a cluster with capacity {@code clusterResource}, compare {@code lhs}
* and {@code rhs} considering all resources.
*
* @param clusterResource
* cluster capacity
* @param lhs
* First {@link Resource} to compare
* @param rhs
* Second {@link Resource} to compare
* @return -1 if {@code lhs} is small... | 3.26 |
hadoop_AggregateAppResourceUsage_getVcoreSeconds_rdh | /**
*
* @return the vcoreSeconds
*/
public long getVcoreSeconds() {
return RMServerUtils.getOrDefault(resourceSecondsMap, ResourceInformation.VCORES.getName(), 0L);
} | 3.26 |
hadoop_AggregateAppResourceUsage_getMemorySeconds_rdh | /**
*
* @return the memorySeconds
*/
public long getMemorySeconds() {
return RMServerUtils.getOrDefault(resourceSecondsMap, ResourceInformation.MEMORY_MB.getName(), 0L);
} | 3.26 |
hadoop_WritableName_getClass_rdh | /**
* Return the class for a name.
* Default is {@link Class#forName(String)}.
*
* @param name
* input name.
* @param conf
* input configuration.
* @return class for a name.
* @throws IOException
* raised on errors performing I/O.
*/
public static synchronized Class<?> getClass(String name, Configurati... | 3.26 |
hadoop_WritableName_getName_rdh | /**
* Return the name for a class.
* Default is {@link Class#getName()}.
*
* @param writableClass
* input writableClass.
* @return name for a class.
*/
public static synchronized String getName(Class<?> writableClass) {
String name = CLASS_TO_NAME.get(writableClass);
if (name != null)
return na... | 3.26 |
hadoop_WritableName_setName_rdh | /**
* Set the name that a class should be known as to something other than the
* class name.
*
* @param writableClass
* input writableClass.
* @param name
* input name.
*/
public static synchronized void setName(Class<?> writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO... | 3.26 |
hadoop_WritableName_addName_rdh | /**
* Add an alternate name for a class.
*
* @param writableClass
* input writableClass.
* @param name
* input name.
*/
public static synchronized void addName(Class<?> writableClass, String name) {
NAME_TO_CLASS.put(name, writableClass);
} | 3.26 |
hadoop_AbstractS3ACommitter_getOutputPath_rdh | /**
* Final path of output, in the destination FS.
*
* @return the path
*/
@Override
public final Path getOutputPath() {
return outputPath;
} | 3.26 |
hadoop_AbstractS3ACommitter_initiateTaskOperation_rdh | /**
* Start a ask commit/abort commit operations.
* This may have a different thread count.
* If configured to collect statistics,
* The IO StatisticsContext is reset.
*
* @param context
* job or task context
* @return a commit context through which the operations can be invoked.
* @throws IOException
* f... | 3.26 |
hadoop_AbstractS3ACommitter_setDestFS_rdh | /**
* Set the destination FS: the FS of the final output.
*
* @param destFS
* destination FS.
*/
protected void setDestFS(FileSystem destFS) {
this.destFS = destFS;
} | 3.26 |
hadoop_AbstractS3ACommitter_updateCommonContext_rdh | /**
* Add jobID to current context.
*/
protected final void updateCommonContext() {
currentAuditContext().put(AuditConstants.PARAM_JOB_ID, f0);
} | 3.26 |
hadoop_AbstractS3ACommitter_abortPendingUploads_rdh | /**
* Abort all pending uploads in the list.
*
* @param commitContext
* commit context
* @param pending
* pending uploads
* @param suppressExceptions
* should exceptions be suppressed?
* @param deleteRemoteFiles
* should remote files be deleted?
* @throws IOException
* any exception raised
*/
pro... | 3.26 |
hadoop_AbstractS3ACommitter_getUUID_rdh | /**
* The Job UUID, as passed in or generated.
*
* @return the UUID for the job.
*/
@VisibleForTesting
public final String getUUID() {
return f0;} | 3.26 |
hadoop_AbstractS3ACommitter_precommitCheckPendingFiles_rdh | /**
* Run a precommit check that all files are loadable.
* This check avoids the situation where the inability to read
* a file only surfaces partway through the job commit, so
* results in the destination being tainted.
*
* @param commitContext
* commit context
* @param pending
* the pending operations
*... | 3.26 |
hadoop_AbstractS3ACommitter_getJobAttemptPath_rdh | /**
* Compute the path where the output of a given job attempt will be placed.
*
* @param context
* the context of the job. This is used to get the
* application attempt ID.
* @return the path to store job attempt data.
*/
public Path getJobAttemptPath(JobContext context) {
return getJobAttemptPath(getA... | 3.26 |
hadoop_AbstractS3ACommitter_maybeCreateSuccessMarkerFromCommits_rdh | /**
* if the job requires a success marker on a successful job,
* create the file {@link CommitConstants#_SUCCESS}.
*
* While the classic committers create a 0-byte file, the S3A committers
* PUT up a the contents of a {@link SuccessData} file.
*
* @param commitContext
* commit context
* @param pending
* ... | 3.26 |
hadoop_AbstractS3ACommitter_loadAndAbort_rdh | /**
* Load a pendingset file and abort all of its contents.
* Invoked within a parallel run; the commitContext thread
* pool is already busy/possibly full, so do not
* execute work through the same submitter.
*
* @param commitContext
* context to commit through
* @param act... | 3.26 |
hadoop_AbstractS3ACommitter_loadAndRevert_rdh | /**
* Load a pendingset file and revert all of its contents.
* Invoked within a parallel run; the commitContext thread
* pool is already busy/possibly full, so do not
* execute work through the same submitter.
*
* @param commitContext
* context to commit through
* @param activeCommit
* commit state
* @par... | 3.26 |
hadoop_AbstractS3ACommitter_setupTask_rdh | /**
* Task setup. Fails if the the UUID was generated locally, and
* the same committer wasn't used for job setup.
* {@inheritDoc }
*
* @throws PathCommitException
* if the task UUID options are unsatisfied.
*/
@Override
public voi... | 3.26 |
hadoop_AbstractS3ACommitter_cleanup_rdh | /**
* Cleanup the job context, including aborting anything pending
* and destroying the thread pool.
*
* @param commitContext
* commit context
* @param suppressExceptions
* should exceptions be suppressed?
* @throws IOException
* any failure if exceptions were not suppressed.
*/
protected void cleanup(C... | 3.26 |
hadoop_AbstractS3ACommitter_recoverTask_rdh | /**
* Task recovery considered Unsupported: Warn and fail.
*
* @param taskContext
* Context of the task whose output is being recovered
* @throws IOException
* always.
*/
@Override
public void recoverTask(TaskAttemptContext taskContext) throws IOException {
LOG.warn("Cannot recover task {}", taskContex... | 3.26 |
hadoop_AbstractS3ACommitter_commitJob_rdh | /**
* Commit work.
* This consists of two stages: precommit and commit.
* <p>
* Precommit: identify pending uploads, then allow subclasses
* to validate the state of the destination and the pending uploads.
* Any failure here triggers an abort of all pending uploads.
* <p>
* Commit internal: do the final commit... | 3.26 |
hadoop_AbstractS3ACommitter_getDestS3AFS_rdh | /**
* Get the destination as an S3A Filesystem; casting it.
*
* @return the dest S3A FS.
* @throws IOException
* if the FS cannot be instantiated.
*/
public S3AFileSystem getDestS3AFS() throws IOException {
return ((S3AFileSystem) (getDestFS()));
} | 3.26 |
hadoop_AbstractS3ACommitter_abortPendingUploadsInCleanup_rdh | /**
* Abort all pending uploads to the destination directory during
* job cleanup operations.
* Note: this instantiates the thread pool if required -so
*
* @param suppressExceptions
* should exceptions be suppressed
* @param commitContext
* commit context
* @throws IOException
* IO problem
*/
protected... | 3.26 |
hadoop_AbstractS3ACommitter_getUUIDSource_rdh | /**
* Source of the UUID.
*
* @return how the job UUID was retrieved/generated.
*/
@VisibleForTesting
public final JobUUIDSource getUUIDSource() {
return uuidSource;
} | 3.26 |
hadoop_AbstractS3ACommitter_getTaskAttemptPath_rdh | /**
* Compute the path where the output of a task attempt is stored until
* that task is committed. This may be the normal Task attempt path
* or it may be a subdirectory.
* The default implementation returns the value of
* {@link #getBaseTaskAttemptPath(TaskAttemptContext)};
* subclasses may return different val... | 3.26 |
hadoop_AbstractS3ACommitter_loadAndCommit_rdh | /**
* Load a pendingset file and commit all of its contents.
* Invoked within a parallel run; the commitContext thread
* pool is already busy/possibly full, so do not
* execute work through the same submitter.
*
* @param commitContext
* context to commit through
* @param activeCommit
* commit state
* @par... | 3.26 |
hadoop_AbstractS3ACommitter_maybeCreateSuccessMarker_rdh | /**
* if the job requires a success marker on a successful job,
* create the {@code _SUCCESS} file.
*
* While the classic committers create a 0-byte file, the S3A committers
* PUT up a the contents of a {@link SuccessData} file.
* The file is returned, even if no marker is created.
* This is so it can be saved t... | 3.26 |
hadoop_AbstractS3ACommitter_maybeIgnore_rdh | /**
* Log or rethrow a caught IOException.
*
* @param suppress
* should raised IOEs be suppressed?
* @param action
* action (for logging when the IOE is suppressed.
* @param ex
* exception
* @throws IOException
* if suppress == false
*/
protected void maybeIgnore(boolean suppress, String action, IOEx... | 3.26 |
hadoop_AbstractS3ACommitter_initiateJobOperation_rdh | /**
* Start the final job commit/abort commit operations.
* If configured to collect statistics,
* The IO StatisticsContext is reset.
*
* @param context
* job context
* @return a commit context through which the operations can be invoked.
* @throws IOException
* failure.
*/
protected CommitContext initiat... | 3.26 |
hadoop_AbstractS3ACommitter_preCommitJob_rdh | /**
* Subclass-specific pre-Job-commit actions.
* The staging committers all load the pending files to verify that
* they can be loaded.
* The Magic committer does not, because of the overhead of reading files
* from S3 makes it too expensive.
*
* @param commitContext
* commit context
* @param pending
* t... | 3.26 |
hadoop_AbstractS3ACommitter_setWorkPath_rdh | /**
* Set the work path for this committer.
*
* @param workPath
* the work path to use.
*/
protected final void
setWorkPath(Path workPath) {
LOG.debug("Setting work path to {}", workPath);
this.workPath = workPath;
} | 3.26 |
hadoop_AbstractS3ACommitter_getTaskCommitThreadCount_rdh | /**
* Get the thread count for this task's commit operations.
*
* @param context
* the JobContext for this commit
* @return a possibly zero thread count.
*/
private int getTaskCommitThreadCount(final JobContext context) {
return context.getConfiguration().getInt(FS_S3A_COMMITTER_THREADS, DEFAULT_COMMITTER_THR... | 3.26 |
hadoop_AbstractS3ACommitter_getDestinationFS_rdh | /**
* Get the destination filesystem from the output path and the configuration.
*
* @param out
* output path
* @param config
* job/task config
* @return the associated FS
* @throws PathCommitException
* output path isn't to an S3A FS instance.
* @throws IOException
* failure to instantiate the FS.
... | 3.26 |
hadoop_AbstractS3ACommitter_uploadCommitted_rdh | /**
* Note that a file was committed.
* Increase the counter of files and total size.
* If there is room in the committedFiles list, the file
* will be added to the list and so end up in the _SUCCESS file.
*
* @param key
* key of the committed object.
* @param size
* size in bytes.
*/
public synchronized ... | 3.26 |
hadoop_AbstractS3ACommitter_fromStatusIterator_rdh | /**
* Create an active commit of the given pending files.
*
* @param pendingFS
* source filesystem.
* @param statuses
* iterator of file status or subclass to use.
* @return the commit
* @throws IOException
* if the iterator raises one.
*/
public static ActiveCommit fromStatusIterator(final FileSystem p... | 3.26 |
hadoop_AbstractS3ACommitter_getRole_rdh | /**
* Used in logging and reporting to help disentangle messages.
*
* @return the committer's role.
*/
protected String getRole() {
return role;
} | 3.26 |
hadoop_AbstractS3ACommitter_warnOnActiveUploads_rdh | /**
* Scan for active uploads and list them along with a warning message.
* Errors are ignored.
*
* @param path
* output path of job.
*/
protected void
warnOnActiveUploads(final Path path) {
List<MultipartUpload> pending;
try {
pending = getCommitOperations().listPendingUploadsUnderPath(path);
} catch (IO... | 3.26 |
hadoop_AbstractS3ACommitter_requiresDelayedCommitOutputInFileSystem_rdh | /**
* Flag to indicate whether or not the destination filesystem needs
* to be configured to support magic paths where the output isn't immediately
* visible. If the committer returns true, then committer setup will
* fail if the FS doesn't have the capability.
* Base implementation returns false.
*
* @return wh... | 3.26 |
hadoop_AbstractS3ACommitter_setOutputPath_rdh | /**
* Set the output path.
*
* @param outputPath
* new value
*/
protected final void setOutputPath(Path outputPath) {
this.outputPath = requireNonNull(outputPath, "Null output path");
} | 3.26 |
hadoop_AbstractS3ACommitter_setupJob_rdh | /**
* Base job setup (optionally) deletes the success marker and
* always creates the destination directory.
* When objects are committed that dest dir marker will inevitably
* be deleted; creating it now ensures there is something at the end
* while the job is in progress -and if nothing is created, that
* it is... | 3.26 |
hadoop_AbstractS3ACommitter_m0_rdh | /**
* Create the success data structure from a job context.
*
* @param context
* job context.
* @param filenames
* short list of filenames; nullable
* @param ioStatistics
* IOStatistics snapshot
* @param destConf
* config of the dest fs, can be null
* @return the structure
*/
private SuccessData m... | 3.26 |
hadoop_AbstractS3ACommitter_getCommitOperations_rdh | /**
* Get the commit actions instance.
* Subclasses may provide a mock version of this.
*
* @return the commit actions instance to use for operations.
*/
protected CommitOperations getCommitOperations() {return commitOperations;
} | 3.26 |
hadoop_AbstractS3ACommitter_commitJobInternal_rdh | /**
* Internal Job commit operation: where the S3 requests are made
* (potentially in parallel).
*
* @param commitContext
* commit context
* @param pending
* pending commits
* @throws IOException
* any failure
*/
protected void commitJobInternal(final CommitContext commitContext, final ActiveCommit pen... | 3.26 |
hadoop_AbstractS3ACommitter_getText_rdh | /**
* Source for messages.
*
* @return text
*/
public String getText() {
return text;
} | 3.26 |
hadoop_AbstractS3ACommitter_m1_rdh | /**
* Build the job UUID.
*
* <p>
* In MapReduce jobs, the application ID is issued by YARN, and
* unique across all jobs.
* </p>
* <p>
* Spark will use a fake app ID based on the current time.
* This can lead to collisions on busy clusters unless
* the specific spark release has SPARK-33402 applied.
* Thi... | 3.26 |
hadoop_AbstractS3ACommitter_abortJobInternal_rdh | /**
* The internal job abort operation; can be overridden in tests.
* This must clean up operations; it is called when a commit fails, as
* well as in an {@link #abortJob(JobContext, JobStatus.State)} call.
* The base implementation calls {@link #cleanup(CommitContext, boolean)}
* so cleans up the filesystems and ... | 3.26 |
hadoop_AbstractS3ACommitter_empty_rdh | /**
* Get the empty entry.
*
* @return an active commit with no pending files.
*/
public static ActiveCommit empty() {return EMPTY;
} | 3.26 |
hadoop_AbstractS3ACommitter_getJobCommitThreadCount_rdh | /**
* Get the thread count for this job's commit operations.
*
* @param context
* the JobContext for this commit
* @return a possibly zero thread count.
*/
private int getJobCommitThreadCount(final JobContext context) {
return context.getConfiguration().getInt(FS_S3A_COMMITTER_THREADS, DEFAULT_COMMITTER_THREADS... | 3.26 |
hadoop_AbstractS3ACommitter_pendingsetCommitted_rdh | /**
* Callback when a pendingset has been committed,
* including any source statistics.
*
* @param sourceStatistics
* any source statistics
*/
public void pendingsetCommitted(final IOStatistics sourceStatistics) {
ioStatistics.aggregate(sourceStatistics);
} | 3.26 |
hadoop_AbstractS3ACommitter_getTaskAttemptFilesystem_rdh | /**
* Get the task attempt path filesystem. This may not be the same as the
* final destination FS, and so may not be an S3A FS.
*
* @param context
* task attempt
* @return the filesystem
* @throws IOException
* failure to instantiate
*/
protected FileSystem getTaskAttemptFilesystem(TaskAttemptContext cont... | 3.26 |
hadoop_AbstractS3ACommitter_maybeSaveSummary_rdh | /**
* Save a summary to the report dir if the config option
* is set.
* The report will be updated with the current active stage,
* and if {@code thrown} is non-null, it will be added to the
* diagnostics (and the job tagged as a failure).
* Static for testability.
*
* @param activeStage
* active stage
* @p... | 3.26 |
hadoop_AbstractS3ACommitter_commitPendingUploads_rdh | /**
* Commit all the pending uploads.
* Each file listed in the ActiveCommit instance is queued for processing
* in a separate thread; its contents are loaded and then (sequentially)
* committed.
* On a failure or abort of a single file's commit, all its uploads are
* aborted.
* The revert operation lists the fi... | 3.26 |
hadoop_AbstractS3ACommitter_startOperation_rdh | /**
* Start an operation; retrieve an audit span.
*
* All operation names <i>SHOULD</i> come from
* {@code StoreStatisticNames} or
* {@code StreamStatisticNames}.
*
* @param name
* operation name.
* @param path1
* first path of operation
* @param path2
* second path of operation
* @return a span for ... | 3.26 |
hadoop_AbstractS3ACommitter_getDestFS_rdh | /**
* Get the destination FS, creating it on demand if needed.
*
* @return the filesystem; requires the output path to be set up
* @throws IOException
* if the FS cannot be instantiated.
*/
public FileSystem getDestF... | 3.26 |
hadoop_AbstractS3ACommitter_initOutput_rdh | /**
* Init the output filesystem and path.
* TESTING ONLY; allows mock FS to cheat.
*
* @param out
* output path
* @throws IOException
* failure to create the FS.
*/
@VisibleForTesting
protected void initOutput(Path out) throws IOException {
FileSystem fs = getDestinationFS(out, getConf());
setDestF... | 3.26 |
hadoop_AbstractS3ACommitter_getWorkPath_rdh | /**
* This is the critical method for {@code FileOutputFormat}; it declares
* the path for work.
*
* @return the working path.
*/
@Override
public final Path getWorkPath() {
return workPath;
} | 3.26 |
hadoop_AbstractS3ACommitter_jobCompleted_rdh | /**
* Job completion outcome; this may be subclassed in tests.
*
* @param success
* did the job succeed.
*/
protected void jobCompleted(boolean success) {
getCommitOperations().jobCompleted(success);
} | 3.26 |
hadoop_HashPartitioner_getPartition_rdh | /**
* Use {@link Object#hashCode()} to partition.
*/
public int getPartition(K2 key, V2
value, int numReduceTasks) {
return (key.hashCode() & Integer.MAX_VALUE) % numReduceTasks;
} | 3.26 |
hadoop_ShellWrapper_getDeviceFileType_rdh | /**
* A shell Wrapper to ease testing.
*/public class ShellWrapper
{public String getDeviceFileType(String devName) throws IOException {
Shell.ShellCommandExecutor shexec = new Shell.ShellCommandExecutor(new String[]{ "stat", "-c", "%F", devName } | 3.26 |
hadoop_WorkloadMapper_configureJob_rdh | /**
* Setup input and output formats and optional reducer.
*/
public void configureJob(Job job) {
job.setInputFormatClass(VirtualInputFormat.class);
job.setNumReduceTasks(0);
job.setOutputKeyClass(NullWritable.class);
job.setOutputValueClass(NullWritable.class);
job.setOutputFormatClass(NullOutput... | 3.26 |
hadoop_StateStoreSerializer_newRecord_rdh | /**
* Create a new record.
*
* @param clazz
* Class of the new record.
* @param <T>
* Type of the record.
* @return New record.
*/
public static <T> T newRecord(Class<T> clazz) {
return getSerializer(null).newRecordInstance(clazz);
} | 3.26 |
hadoop_StateStoreSerializer_getSerializer_rdh | /**
* Get a serializer based on the provided configuration.
*
* @param conf
* Configuration. Default if null.
* @return Singleton serializer.
*/
public static StateStoreSerializer getSerializer(Configuration conf) {
if (conf == null) {
synchronized(StateStoreSerializer.class)... | 3.26 |
hadoop_ErasureCodec_getCoderOptions_rdh | /**
* Get a {@link ErasureCoderOptions}.
*
* @return erasure coder options
*/
public ErasureCoderOptions getCoderOptions() {
return coderOptions;
} | 3.26 |
hadoop_Chunk_readLength_rdh | /**
* Reading the length of next chunk.
*
* @throws java.io.IOException
* when no more data is available.
*/
private void readLength() throws IOException {
remain = Utils.readVInt(in);
if (remain >= 0) {
lastChunk = true;
} else {remain = -remain;
}
} | 3.26 |
hadoop_Chunk_writeChunk_rdh | /**
* Write out a chunk.
*
* @param chunk
* The chunk buffer.
* @param offset
* Offset to chunk buffer for the beginning of chunk.
* @param len
* @param last
* Is this the last call to flushBuffer?
*/
private void writeChunk(byte[] chunk, int offset, int len, boolean last) throws IOException {
if (l... | 3.26 |
hadoop_Chunk_writeBufData_rdh | /**
* Write out a chunk that is a concatenation of the internal buffer plus
* user supplied data. This will never be the last block.
*
* @param data
* User supplied data buffer.
* @param offset
* Offset to user data buffer.
* @param len
* User data buffer size.
*/
private void writeBufData(byte[] data, ... | 3.26 |
hadoop_Chunk_getRemain_rdh | /**
* How many bytes remain in the current chunk?
*
* @return remaining bytes left in the current chunk.
* @throws java.io.IOException
*/
public int getRemain() throws IOException {
checkEOF();
return remain;
} | 3.26 |
hadoop_Chunk_isLastChunk_rdh | /**
* Have we reached the last chunk.
*
* @return true if we have reached the last chunk.
* @throws java.io.IOException
*/
public boolean isLastChunk() throws IOException {
checkEOF();
return lastChunk;
} | 3.26 |
hadoop_Chunk_flushBuffer_rdh | /**
* Flush the internal buffer.
*
* Is this the last call to flushBuffer?
*
* @throws java.io.IOException
*/ private void flushBuffer() throws IOException {
if (count > 0) {
writeChunk(buf, 0, count, false);
count = 0;
}
} | 3.26 |
hadoop_RpcAcceptedReply_fromValue_rdh | /* e.g. memory allocation failure */
public static AcceptState fromValue(int value) {
return
values()[value];
} | 3.26 |
hadoop_HttpFSReleaseFilter_getFileSystemAccess_rdh | /**
* Returns the {@link FileSystemAccess} service to return the FileSystemAccess filesystem
* instance to.
*
* @return the FileSystemAccess service.
*/
@Override
protected FileSystemAccess getFileSystemAccess() {
return HttpFSServerWebApp.get().get(FileSystemAccess.class);
} | 3.26 |
hadoop_SampleQuantiles_insert_rdh | /**
* Add a new value from the stream.
*
* @param v
* v.
*/public synchronized void insert(long v) {
buffer[bufferCount] = v;
bufferCount++;
count++;
if (bufferCount == buffer.length) {
insertBatch();
compress();
}
} | 3.26 |
hadoop_SampleQuantiles_compress_rdh | /**
* Try to remove extraneous items from the set of sampled items. This checks
* if an item is unnecessary based on the desired error bounds, and merges it
* with the adjacent item if it is.
*/
private void compress() {
if (samples.size() < 2) {
return;
}
ListIterator<SampleItem> it = samples.... | 3.26 |
hadoop_SampleQuantiles_allowableError_rdh | /**
* Specifies the allowable error for this rank, depending on which quantiles
* are being targeted.
*
* This is the f(r_i, n) function from the CKMS paper. It's basically how wide
* the range of this rank can be.
*
* @param rank
* the index in the list of samples
*/
private double allowableError(int rank) ... | 3.26 |
hadoop_SampleQuantiles_query_rdh | /**
* Get the estimated value at the specified quantile.
*
* @param quantile
* Queried quantile, e.g. 0.50 or 0.99.
* @return Estimated value at that quantile.
*/
private long query(double quantile) {
Preconditions.checkState(!samples.isEmpty(), "no data in estimator");
int rankMin = 0;
int desired ... | 3.26 |
hadoop_SampleQuantiles_clear_rdh | /**
* Resets the estimator, clearing out all previously inserted items
*/
public synchronized void clear() {
count = 0;
bufferCount = 0;
samples.clear();
} | 3.26 |
hadoop_SampleQuantiles_getSampleCount_rdh | /**
* Returns the number of samples kept by the estimator
*
* @return count current number of samples
*/
@VisibleForTesting
public synchronized int getSampleCount() {
return samples.size();
} | 3.26 |
hadoop_SampleQuantiles_getCount_rdh | /**
* Returns the number of items that the estimator has processed
*
* @return count total number of items processed
*/
public synchronized long getCount()
{
return count;
} | 3.26 |
hadoop_SampleQuantiles_insertBatch_rdh | /**
* Merges items from buffer into the samples array in one pass.
* This is more efficient than doing an insert on every item.
*/
private void insertBatch() {
if (bufferCount == 0) {
return;
}
Arrays.sort(buffer, 0, bufferCount);
// Base case: no samples
int start = 0;
if (samples.si... | 3.26 |
hadoop_KeyFieldBasedComparator_configure_rdh | /**
* This comparator implementation provides a subset of the features provided
* by the Unix/GNU Sort. In particular, the supported features are:
* -n, (Sort numerically)
* -r, (Reverse the result of comparison)
* -k pos1[,pos2], where pos is of the form f[.c][opts], where f is the number
* of the field to use,... | 3.26 |
hadoop_MapHost_markAvailable_rdh | /**
* Called when the node is done with its penalty or done copying.
*
* @return the host's new state
*/
public synchronized State markAvailable()
{
if (maps.isEmpty()) {
state = State.IDLE;
} else {
state = State.PENDING;
}
return state;
} | 3.26 |
hadoop_MapHost_penalize_rdh | /**
* Mark the host as penalized
*/
public synchronized void penalize() {state = State.PENALIZED;
} | 3.26 |
hadoop_DelegationBindingInfo_withCredentialProviders_rdh | /**
* Set builder value.
*
* @param value
* non null value
* @return the builder
*/
public DelegationBindingInfo withCredentialProviders(final AWSCredentialProviderList value) {
credentialProviders = requireNonNull(value);
return this;
} | 3.26 |
hadoop_DelegationBindingInfo_getCredentialProviders_rdh | /**
* Get list of credential providers.
*
* @return list of credential providers
*/
public AWSCredentialProviderList getCredentialProviders() {
return credentialProviders;
} | 3.26 |
hadoop_RMWebAppUtil_createAppSubmissionContext_rdh | /**
* Create the actual ApplicationSubmissionContext to be submitted to the RM
* from the information provided by the user.
*
* @param newApp
* the information provided by the user
* @param conf
* RM configuration
* @return returns the ... | 3.26 |
hadoop_RMWebAppUtil_m0_rdh | /**
* Create the ContainerLaunchContext required for the
* ApplicationSubmissionContext. This function takes the user information and
* generates the ByteBuffer structures required by the ContainerLaunchContext
*
* @param newApp
* the information provided by the user
* @return created context
* @throws BadReq... | 3.26 |
hadoop_RMWebAppUtil_getCallerUserGroupInformation_rdh | /**
* Helper method to retrieve the UserGroupInformation from the
* HttpServletRequest.
*
* @param hsr
* the servlet request
* @param usePrincipal
* true if we need to use the principal user, remote
* otherwise.
* @return the user group information of the caller.
*/
public static UserGroupInformation ge... | 3.26 |
hadoop_RMWebAppUtil_createCredentials_rdh | /**
* Generate a Credentials object from the information in the CredentialsInfo
* object.
*
* @param credentials
* the CredentialsInfo provided by the user.
* @return */private static Credentials createCredentials(CredentialsInfo credentials) {Credentials ret = new Credentials();
try {
for (Map.Ent... | 3.26 |
hadoop_RMWebAppUtil_setupSecurityAndFilters_rdh | /**
* Helper method to setup filters and authentication for ResourceManager
* WebServices.
*
* Use the customized yarn filter instead of the standard kerberos filter to
* allow users to authenticate using delegation tokens 4 conditions need to be
* satisfied:
*
* 1. security is enabled.
*
* 2. http auth type ... | 3.26 |
hadoop_CDFPiecewiseLinearRandomGenerator_valueAt_rdh | /**
* TODO This code assumes that the empirical minimum resp. maximum is the
* epistomological minimum resp. maximum. This is probably okay for the
* minimum, because that likely represents a task where everything went well,
* but for the maximum we may want to develop a way of extrapolating past the
* maximum.
*... | 3.26 |
hadoop_BlobOperationDescriptor_getContentLengthIfKnown_rdh | /**
* Gets the content length for the Azure Storage operation, or returns zero if
* unknown.
*
* @param conn
* the connection object for the Azure Storage operation.
* @param operationType
* the Azure Storage operation type.
* @return the content length, or zero if unknown.
*/
static long getContentLengthI... | 3.26 |
hadoop_BlobOperationDescriptor_getOperationType_rdh | /**
* Gets the operation type of an Azure Storage operation.
*
* @param conn
* the connection object for the Azure Storage operation.
* @return the operation type.
*/static OperationType getOperationType(HttpURLConnection conn)
{
OperationType operationType = OperationTyp... | 3.26 |
hadoop_CredentialProviderListFactory_createAWSV2CredentialProvider_rdh | /**
* Create an AWS v2 credential provider from its class by using reflection.
*
* @param conf
* configuration
* @param className
* credential class name
* @param uri
* URI of the FS
* @param key
* configuration key to use
* @return the instantiated class
* @throws IOException
* on any instantiat... | 3.26 |
hadoop_CredentialProviderListFactory_initCredentialProvidersMap_rdh | /**
* Maps V1 credential providers to either their equivalent SDK V2 class or hadoop provider.
*/
private static Map<String, String> initCredentialProvidersMap() {
Map<String, String> v1v2CredentialProviderMap = new HashMap<>();
v1v2CredentialProviderMap.put(ANONYMOUS_CREDENTIALS_V1, AnonymousAWSCredentialsPr... | 3.26 |
hadoop_CredentialProviderListFactory_buildAWSProviderList_rdh | /**
* Load list of AWS credential provider/credential provider factory classes;
* support a forbidden list to prevent loops, mandate full secrets, etc.
*
* @param binding
* Binding URI -may be null
* @param conf
* configuration
* @param key
* configuration key to use
* @param forbidden
* a possibly e... | 3.26 |
hadoop_FederationStateStoreHeartbeat_updateClusterState_rdh | /**
* Get the current cluster state as a JSON string representation of the
* {@link ClusterMetricsInfo}.
*/
private void updateClusterState() {
try {
// get the current state
currentClusterState.getBuffer().setLength(0);
ClusterMetricsInfo clusterMetricsInfo = new ClusterMetricsInfo(rs);... | 3.26 |
hadoop_TimelineMetricOperation_m0_rdh | /**
* Replace the base metric with the incoming value. Stateless operation.
*
* @param incoming
* Metric a
* @param base
* Metric b
* @param state
* Operation state (not used)
* @return Metric a
*/
@Override
public TimelineMetric m0(TimelineMetric incoming, TimelineMetric base, Map<Object, Object> state... | 3.26 |
hadoop_TimelineMetricOperation_exec_rdh | /**
* Return the average value of the incoming metric and the base metric,
* with a given state. Not supported yet.
*
* @param incoming
* Metric a
* @param base
* Metric b
* @param state
* Operation state
* @return Not finished yet
*/
@Override
public TimelineMetric exec(TimelineMetric incoming, Timeli... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.