name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_PerGpuTemperature_getSlowThresholdGpuTemp_rdh | /**
* Get celsius GPU temperature which could make GPU runs slower
*
* @return temperature
*/
@XmlJavaTypeAdapter(StrToFloatBeforeSpaceAdapter.class)
@XmlElement(name = "gpu_temp_slow_threshold")
public Float getSlowThresholdGpuTemp() {
return slowThresholdGpuTemp;
} | 3.26 |
hadoop_PerGpuTemperature_getCurrentGpuTemp_rdh | /**
* Get current celsius GPU temperature
*
* @return temperature
*/
@XmlJavaTypeAdapter(StrToFloatBeforeSpaceAdapter.class)
@XmlElement(name = "gpu_temp")
public Float getCurrentGpuTemp() {
return currentGpuTemp;
} | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withLongFunctionGauge_rdh | /**
* Add a new evaluator to the gauge statistics.
*
* @param key
* key of this statistic
* @param eval
* evaluator for the statistic
* @return the builder.
*/
public DynamicIOStatisticsBuilder withLongFunctionGauge(String key, ToLongFunction<String> eval)
{
activeInstance().addGaugeFunction(key, eval::... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withMeanStatisticFunction_rdh | /**
* Add a new evaluator to the mean statistics.
*
* This is a function which must return the mean and the sample count.
*
* @param key
* key of this statistic
* @param eval
* evaluator for the statistic
* @return the builder.
*/
public DynamicIOStatisticsBuilder withMeanStatisticFunction(String key, Fun... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicLongMinimum_rdh | /**
* Add a minimum statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic long minimum
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicLongMinimum(String key, AtomicLong source) {
withLongFunctionMinimum(... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_build_rdh | /**
* Build the IOStatistics instance.
*
* @return an instance.
* @throws IllegalStateException
* if the builder has already been built.
*/
public IOStatistics build() {
final DynamicIOStatistics stats = activeInstance();
// stop the builder from working any more... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicIntegerCounter_rdh | /**
* Add a counter statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic int counter
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicIntegerCounter(String key, AtomicInteger source) {
withLongFunctionCoun... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicLongMaximum_rdh | /**
* Add a maximum statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic long maximum
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicLongMaximum(String key, AtomicLong source) {
withLongFunctionMaximum(k... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withLongFunctionCounter_rdh | /**
* Add a new evaluator to the counter statistics.
*
* @param key
* key of this statistic
* @param eval
* evaluator for the statistic
* @return the builder.
*/
public DynamicIOStatisticsBuilder withLongFunctionCounter(String key, ToLongFunction<String> eval) {
activeInstance().addCounterFunction(key,... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicIntegerMinimum_rdh | /**
* Add a minimum statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic int minimum
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicIntegerMinimum(String key, AtomicInteger source) {
withLongFunctionMini... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withMutableCounter_rdh | /**
* Build a dynamic counter statistic from a
* {@link MutableCounterLong}.
*
* @param key
* key of this statistic
* @param source
* mutable long counter
* @return the builder.
*/
public DynamicIOStatisticsBuilder withMutableCounter(String key, MutableCounterLong source) {
withLongFunctionCounter(key... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withLongFunctionMinimum_rdh | /**
* Add a new evaluator to the minimum statistics.
*
* @param key
* key of this statistic
* @param eval
* evaluator for the statistic
* @return the builder.
*/
public DynamicIOStatisticsBuilder withLongFunctionMinimum(String key, ToLongFunction<String> eval) {
activeInstance().addMinimumFunction(key, ... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withLongFunctionMaximum_rdh | /**
* Add a new evaluator to the maximum statistics.
*
* @param key
* key of this statistic
* @param eval
* evaluator for the statistic
* @return the builder.
*/public DynamicIOStatisticsBuilder withLongFunctionMaximum(String key,
ToLongFunction<String> eval) {
activeInstance().addMaximumFunction(key, e... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicLongGauge_rdh | /**
* Add a gauge statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic long gauge
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicLongGauge(String key, AtomicLong source) {
withLongFunctionGauge(key, s ->... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicIntegerMaximum_rdh | /**
* Add a maximum statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic int maximum
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicIntegerMaximum(String key, AtomicInteger source) {
withLongFunctionMax... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_withAtomicLongCounter_rdh | /**
* Add a counter statistic to dynamically return the
* latest value of the source.
*
* @param key
* key of this statistic
* @param source
* atomic long counter
* @return the builder.
*/
public DynamicIOStatisticsBuilder withAtomicLongCounter(String key, AtomicLong source) {
withLongFunctionCounter(k... | 3.26 |
hadoop_DynamicIOStatisticsBuilder_activeInstance_rdh | /**
* Get the statistics instance.
*
* @return the instance to build/return
* @throws IllegalStateException
* if the builder has already been built.
*/
private DynamicIOStatistics activeInstance() {
checkState(instance != null,
"Already built");
return instance;
} | 3.26 |
hadoop_AllocateResponse_setUpdateErrors_rdh | /**
* Set the list of container update errors to inform the
* Application Master about the container updates that could not be
* satisfied due to error.
*
* @param updateErrors
* list of <code>UpdateContainerError</code> for
* containers updates requests that were in error
*/
@Public
@Unstablepublic void se... | 3.26 |
hadoop_AllocateResponse_containersFromPreviousAttempt_rdh | /**
* Set the <code>containersFromPreviousAttempt</code> of the response.
*
* @see AllocateResponse#setContainersFromPreviousAttempts(List)
* @param containersFromPreviousAttempt
* <code>containersFromPreviousAttempt</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public ... | 3.26 |
hadoop_AllocateResponse_amRmToken_rdh | /**
* Set the <code>amRmToken</code> of the response.
*
* @see AllocateResponse#setAMRMToken(Token)
* @param amRmToken
* <code>amRmToken</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder amRmToken(Token amRmToken) {
allocateResponse.setAMR... | 3.26 |
hadoop_AllocateResponse_getUpdateErrors_rdh | /**
* Get the list of container update errors to inform the
* Application Master about the container updates that could not be
* satisfied due to error.
*
* @return List of Update Container Errors.
*/
@Public
@Unstable
public List<UpdateContainerError> getUpdateErrors() {
return new ArrayList<>();
} | 3.26 |
hadoop_AllocateResponse_numClusterNodes_rdh | /**
* Set the <code>numClusterNodes</code> of the response.
*
* @see AllocateResponse#setNumClusterNodes(int)
* @param numClusterNodes
* <code>numClusterNodes</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder numClusterNodes(int numClusterNo... | 3.26 |
hadoop_AllocateResponse_updatedContainers_rdh | /**
* Set the <code>updatedContainers</code> of the response.
*
* @see AllocateResponse#setUpdatedContainers(List)
* @param updatedContainers
* <code>updatedContainers</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder updatedContainers(List<Up... | 3.26 |
hadoop_AllocateResponse_updatedNodes_rdh | /**
* Set the <code>updatedNodes</code> of the response.
*
* @see AllocateResponse#setUpdatedNodes(List)
* @param updatedNodes
* <code>updatedNodes</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder updatedNodes(List<NodeReport> updatedNodes) {... | 3.26 |
hadoop_AllocateResponse_availableResources_rdh | /**
* Set the <code>availableResources</code> of the response.
*
* @see AllocateResponse#setAvailableResources(Resource)
* @param availableResources
* <code>availableResources</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder availableResource... | 3.26 |
hadoop_AllocateResponse_completedContainersStatuses_rdh | /**
* Set the <code>completedContainersStatuses</code> of the response.
*
* @see AllocateResponse#setCompletedContainersStatuses(List)
* @param completedContainersStatuses
* <code>completedContainersStatuses</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateR... | 3.26 |
hadoop_AllocateResponse_responseId_rdh | /**
* Set the <code>responseId</code> of the response.
*
* @see AllocateResponse#setResponseId(int)
* @param responseId
* <code>responseId</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder responseId(int responseId) {
allocateResponse.setR... | 3.26 |
hadoop_AllocateResponse_allocatedContainers_rdh | /**
* Set the <code>allocatedContainers</code> of the response.
*
* @see AllocateResponse#setAllocatedContainers(List)
* @param allocatedContainers
* <code>allocatedContainers</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder allocatedContaine... | 3.26 |
hadoop_AllocateResponse_collectorInfo_rdh | /**
* Set the <code>collectorInfo</code> of the response.
*
* @see AllocateResponse#setCollectorInfo(CollectorInfo)
* @param collectorInfo
* <code>collectorInfo</code> of the response which
* contains collector address, RM id, version and collector token.
* @return {@link AllocateResponseBuilder}
*/@Private... | 3.26 |
hadoop_AllocateResponse_preemptionMessage_rdh | /**
* Set the <code>preemptionMessage</code> of the response.
*
* @see AllocateResponse#setPreemptionMessage(PreemptionMessage)
* @param preemptionMessage
* <code>preemptionMessage</code> of the response
* @return {@link AllocateResponseBuilder}
*/@Private
@Unstable
public AllocateResponseBuilder preemptionMe... | 3.26 |
hadoop_AllocateResponse_updateErrors_rdh | /**
* Set the <code>updateErrors</code> of the response.
*
* @see AllocateResponse#setUpdateErrors(List)
* @param updateErrors
* <code>updateErrors</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder updateErrors(List<UpdateContainerError> updat... | 3.26 |
hadoop_AllocateResponse_nmTokens_rdh | /**
* Set the <code>nmTokens</code> of the response.
*
* @see AllocateResponse#setNMTokens(List)
* @param nmTokens
* <code>nmTokens</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder nmTokens(List<NMToken> nmTokens) {
allocateResponse.setNM... | 3.26 |
hadoop_AllocateResponse_applicationPriority_rdh | /**
* Set the <code>applicationPriority</code> of the response.
*
* @see AllocateResponse#setApplicationPriority(Priority)
* @param applicationPriority
* <code>applicationPriority</code> of the response
* @return {@link AllocateResponseBuilder}
*/@Private
@Unstable
public AllocateResponseBuilder applicationPri... | 3.26 |
hadoop_AllocateResponse_amCommand_rdh | /**
* Set the <code>amCommand</code> of the response.
*
* @see AllocateResponse#setAMCommand(AMCommand)
* @param amCommand
* <code>amCommand</code> of the response
* @return {@link AllocateResponseBuilder}
*/
@Private
@Unstable
public AllocateResponseBuilder amCommand(AMCommand amCommand) {
allocateRespons... | 3.26 |
hadoop_AllocateResponse_setRejectedSchedulingRequests_rdh | /**
* Add a list of rejected SchedulingRequests to the AllocateResponse.
*
* @param rejectedRequests
* List of Rejected Scheduling Requests.
*/
@Private
@Unstable
public void
setRejectedSchedulingRequests(List<RejectedSchedulingRequest> rejectedRequests) {
} | 3.26 |
hadoop_Matcher_match_rdh | /**
* Match any datanode with any other datanode.
*/public static final Matcher ANY_OTHER = new Matcher() {
@Override
public boolean match(NetworkTopology cluster, Node left, Node right) {
return left != right;
} | 3.26 |
hadoop_AMRMProxyMetrics_getMetrics_rdh | /**
* Initialize the singleton instance.
*
* @return the singleton
*/
public static AMRMProxyMetrics getMetrics() {
synchronized(AMRMProxyMetrics.class) {if (instance
== null) {
instance = DefaultMetricsSystem.instance().register("AMRMProxyMetrics", "Metrics for the Yarn AMRMProxy", new AMRM... | 3.26 |
hadoop_NativeTaskOutputFiles_getOutputIndexFileForWrite_rdh | /**
* Create a local map output index file name.
*
* @param size
* the size of the file
*/
public Path getOutputIndexFileForWrite(long size) throws IOException {
String path = String.format(OUTPUT_FILE_INDEX_FORMAT_STRING, TASKTRACKER_OUTPUT, id);
return lDirAlloc.getLocalPathForWrite(path, size, conf);... | 3.26 |
hadoop_NativeTaskOutputFiles_getInputFile_rdh | /**
* Return a local reduce input file created earlier
*
* @param mapId
* a map task id
*/
public Path getInputFile(int mapId) throws IOException {
return lDirAlloc.getLocalPathToRead(String.format(REDUCE_INPUT_FILE_FORMAT_STRING, TASKTRACKER_OUTPUT, Integer.valueOf(mapId)), conf);
} | 3.26 |
hadoop_NativeTaskOutputFiles_m0_rdh | /**
* Return the path to local map output file created earlier
*/
public Path m0() throws IOException {
String path = String.format(OUTPUT_FILE_FORMAT_STRING, TASKTRACKER_OUTPUT, id);
return lDirAlloc.getLocalPathToRead(path, conf);
} | 3.26 |
hadoop_NativeTaskOutputFiles_getSpillIndexFile_rdh | /**
* Return a local map spill index file created earlier
*
* @param spillNumber
* the number
*/
public Path getSpillIndexFile(int spillNumber) throws IOException {
String path =
String.format(SPILL_INDEX_FILE_FORMAT_STRING, id, TASKTRACKER_OUTPUT, spillNumber);
return lDirAlloc.getLocalPathToRead(pa... | 3.26 |
hadoop_NativeTaskOutputFiles_getOutputIndexFile_rdh | /**
* Return the path to a local map output index file created earlier
*/
public Path getOutputIndexFile() throws IOException {
String path = String.format(OUTPUT_FILE_INDEX_FORMAT_STRING, TASKTRACKER_OUTPUT, id);
return lDirAlloc.getLocalPathToRead(path, conf);
} | 3.26 |
hadoop_NativeTaskOutputFiles_m1_rdh | /**
* Create a local reduce input file name.
*
* @param mapId
* a map task id
* @param size
* the size of the file
*/
public Path m1(TaskID mapId, long size,
Configuration conf) throws IOException {
return lDirAlloc.getLocalPathForWrite(String.format(REDUCE_INPUT_FILE_FORMAT_STRING, TASKTRACKER_OUTPUT... | 3.26 |
hadoop_NativeTaskOutputFiles_getSpillFileForWrite_rdh | /**
* Create a local map spill file name.
*
* @param spillNumber
* the number
* @param size
* the size of the file
*/
public Path getSpillFileForWrite(int spillNumber, long size) throws IOException {
String path = String.format(SPILL_FILE_FORMAT_STRING, id, TASKTRACKER_OUTPUT, spillNumber);
return l... | 3.26 |
hadoop_NativeTaskOutputFiles_getOutputFileForWrite_rdh | /**
* Create a local map output file name.
*
* @param size
* the size of the file
*/
public Path getOutputFileForWrite(long size) throws IOException {
String path = String.format(OUTPUT_FILE_FORMAT_STRING, TASKTRACKER_OUTPUT, id);
return lDirAlloc.getLocalPathForWrite(path, size, conf);
} | 3.26 |
hadoop_NativeTaskOutputFiles_getSpillFile_rdh | /**
* Return a local map spill file created earlier.
*
* @param spillNumber
* the number
*/
public Path getSpillFile(int spillNumber) throws IOException {
String path = String.format(SPILL_FILE_FORMAT_STRING, id, TASKTRACKER_OUTPUT, spillNumber);
return lDirAlloc.getLocalPathToRead(path, conf);
} | 3.26 |
hadoop_NativeTaskOutputFiles_getSpillIndexFileForWrite_rdh | /**
* Create a local map spill index file name.
*
* @param spillNumber
* the number
* @param size
* the size of the file
*/
public Path getSpillIndexFileForWrite(int spillNumber, long size) throws IOException {String path = String.format(SPILL_INDEX_FILE_FORMAT_STRING, id, TASKTRACKER_OUTPUT, spillNumber);
... | 3.26 |
hadoop_NativeTaskOutputFiles_removeAll_rdh | /**
* Removes all of the files related to a task.
*/
public void removeAll() throws IOException {
conf.deleteLocalFiles(TASKTRACKER_OUTPUT);
} | 3.26 |
hadoop_MonotonicClock_getTime_rdh | /**
* Get current time from some arbitrary time base in the past, counting in
* milliseconds, and not affected by settimeofday or similar system clock
* changes.
*
* @return a monotonic clock that counts in milliseconds.
*/
public long getTime() {
return Time.monotonicNow();
} | 3.26 |
hadoop_EntityTypeReader_getNextRowKey_rdh | /**
* Gets the possibly next row key prefix given current prefix and type.
*
* @param currRowKeyPrefix
* The current prefix that contains user, cluster,
* flow, run, and application id.
* @param entityType
* Current entity type.
* @return A new prefix for the possibly immediately next row key.
*/
private... | 3.26 |
hadoop_LogParserUtil_stringToUnixTimestamp_rdh | /**
* Converts String date to unix timestamp. Note that we assume the time in the
* logs has the same time zone with the machine which runs the
* {@link RmSingleLineParser}.
*
* @param date
* The String date.
* @return Unix time stamp.
* @throws ParseException
* if data conversion from String to unix times... | 3.26 |
hadoop_LogParserUtil_setLogParser_rdh | /**
* Set the {@link LogParser} to use.
*
* @param logParser
* the {@link LogParser} to use.
*/
public void setLogParser(final LogParser logParser) {this.logParser = logParser;} | 3.26 |
hadoop_LogParserUtil_setDateFormat_rdh | /**
* Set date format for the {@link LogParser}.
*
* @param datePattern
* the date pattern in the log.
*/
public void setDateFormat(final String datePattern) {
this.format = new SimpleDateFormat(datePattern);} | 3.26 |
hadoop_LogParserUtil_parseLog_rdh | /**
* Parse the log file/directory.
*
* @param logFile
* the file/directory of the log.
* @throws SkylineStoreException
* if fails to addHistory to
* {@link SkylineStore}.
* @throws IOException
* if fails to parse the log.
* @throws ResourceEstimatorException
* if the {@link LogParser}
* is not ... | 3.26 |
hadoop_AuditingIntegration_exitStage_rdh | /**
* Remove stage from common audit context.
*/
public static void exitStage() {
currentAuditContext().remove(CONTEXT_ATTR_STAGE);
} | 3.26 |
hadoop_AuditingIntegration_enterStage_rdh | /**
* Callback on stage entry.
* Sets the activeStage and updates the
* common context.
*
* @param stage
* new stage
*/
public static void enterStage(String stage) {
currentAuditContext().put(CONTEXT_ATTR_STAGE, stage);
} | 3.26 |
hadoop_AuditingIntegration_updateCommonContextOnCommitterEntry_rdh | /**
* Add jobID to current context; also
* task attempt ID if set.
*/
public static void updateCommonContextOnCommitterEntry(ManifestCommitterConfig committerConfig) {
CommonAuditContext context = currentAuditContext();
context.put(PARAM_JOB_ID, committerConfig.getJobUniqueId());... | 3.26 |
hadoop_AuditingIntegration_updateCommonContextOnCommitterExit_rdh | /**
* Remove commit info at the end of the task or job.
*/
public static void updateCommonContextOnCommitterExit() {
currentAuditContext().remove(PARAM_JOB_ID);
currentAuditContext().remove(CONTEXT_ATTR_TASK_ATTEMPT_ID);
} | 3.26 |
hadoop_AuditReplayCommand_isPoison_rdh | /**
* If true, the thread which consumes this item should not process any further
* items and instead simply terminate itself.
*/
boolean isPoison() {
return false;
} | 3.26 |
hadoop_QueueStateManager_canDelete_rdh | /**
* Whether this queue can be deleted.
*
* @param queueName
* the queue name
* @return true if the queue can be deleted
*/
@SuppressWarnings("unchecked")
public boolean canDelete(String queueName) {
SchedulerQueue<T> queue = queueManager.getQueue(queueName);
if (queue == null) {
LOG.info(("The specified q... | 3.26 |
hadoop_QueueStateManager_stopQueue_rdh | /**
* Stop the queue.
*
* @param queueName
* the queue name
* @throws YarnException
* if the queue does not exist
*/
@SuppressWarnings("unchecked")
public synchronized void stopQueue(String queueName) throws YarnException {
SchedulerQueue<T> queue = queueManager.getQueue(queueName);
if (queue == null) {
... | 3.26 |
hadoop_QueueStateManager_activateQueue_rdh | /**
* Active the queue.
*
* @param queueName
* the queue name
* @throws YarnException
* if the queue does not exist
* or the queue can not be activated.
*/
@SuppressWarnings("unchecked")
public synchronized void activateQueue(String queueName) throws YarnException {
SchedulerQueue<T> queue = queueManager.... | 3.26 |
hadoop_AzureNativeFileSystemStore_isAtomicRenameKey_rdh | /**
* Checks if the given key in Azure storage should have synchronized
* atomic folder rename createNonRecursive implemented.
*/
@Override
public boolean isAtomicRenameKey(String key) {
return isKeyForDirectorySet(key, atomicRenameDirs);
} | 3.26 |
hadoop_AzureNativeFileSystemStore_getInstrumentedContext_rdh | /**
* Creates a new OperationContext for the Azure Storage operation that has
* listeners hooked to it that will update the metrics for this file system.
*
* @param bindConcurrentOOBIo
* - bind to intercept send request call backs to handle OOB I/O.
* @return The OperationContext object to use.
*/
private Oper... | 3.26 |
hadoop_AzureNativeFileSystemStore_suppressRetryPolicyInClientIfNeeded_rdh | /**
* If we're asked by unit tests to not retry, set the retry policy factory in
* the client accordingly.
*/
private void suppressRetryPolicyInClientIfNeeded() {
if (suppressRetryPolicy) {
storageInteractionLayer.setRetryPolicyFactory(new RetryNoRetry());
}
} | 3.26 |
hadoop_AzureNativeFileSystemStore_checkContainer_rdh | /**
* This should be called from any method that does any modifications to the
* underlying container: it makes sure to put the WASB current version in the
* container's metadata if it's not already there.
*/
private ContainerState checkContainer(ContainerAccessType accessType) throws StorageException, AzureExcepti... | 3.26 |
hadoop_AzureNativeFileSystemStore_delete_rdh | /**
* API implementation to delete a blob in the back end azure storage.
*/
@Override
public boolean
delete(String key) throws... | 3.26 |
hadoop_AzureNativeFileSystemStore_connectUsingAnonymousCredentials_rdh | /**
* Connect to Azure storage using anonymous credentials.
*
* @param uri
* - URI to target blob (R/O access to public blob)
* @throws StorageException
* raised on errors communicating with Azure storage.
* @throws IOException
* raised on errors performing I/O or setting up the session.
* @throws URISyn... | 3.26 |
hadoop_AzureNativeFileSystemStore_getHadoopBlockSize_rdh | /**
* Returns the file block size. This is a fake value used for integration
* of the Azure store with Hadoop.
*/
@Override
public long getHadoopBlockSize() {
return hadoopBlockSize;
} | 3.26 |
hadoop_AzureNativeFileSystemStore_connectToAzureStorageInSecureMode_rdh | /**
* Method to set up the Storage Interaction layer in Secure mode.
*
* @param accountName
* - Storage account provided in the initializer
* @param containerName
* - Container name provided in the initializer
* @param sessionUri
* - URI provided in the initializer
*/
private void connectToAzureStorageIn... | 3.26 |
hadoop_AzureNativeFileSystemStore_isOkContainerState_rdh | // Determines whether we have to pull the container information again
// or we can work based off what we already have.
private boolean isOkContainerState(ContainerAccessType accessType) {
switch (currentKnownContainerState) {
case Unknown :
// When using SAS, we can't discover container attribu... | 3.26 |
hadoop_AzureNativeFileSystemStore_m0_rdh | /**
* Checks if the given key in Azure Storage should be stored as a page
* blob instead of block blob.
*/
public boolean m0(String key) {
return isKeyForDirectorySet(key, pageBlobDirs);
} | 3.26 |
hadoop_AzureNativeFileSystemStore_setToString_rdh | /**
* Helper to format a string for log output from Set<String>
*/private String setToString(Set<String> set) {
StringBuilder sb
= new StringBuilder();
int i = 1;
for (String s : set) {
sb.append("/" + s);
if (i != set.size()) {
sb.append(", ");
}
i++;
... | 3.26 |
hadoop_AzureNativeFileSystemStore_getDirectorySet_rdh | /**
* Take a comma-separated list of directories from a configuration variable
* and transform it to a set of directories.
*/
private Set<String> getDirectorySet(final String configVar) throws AzureException {
String[] rawDirs = sessionConfiguration.getStrings(configVar, new String[0]);S... | 3.26 |
hadoop_AzureNativeFileSystemStore_finalize_rdh | // Finalizer to ensure complete shutdown
@Override
protected void finalize() throws Throwable {LOG.debug("finalize() called");
close();
super.finalize();
} | 3.26 |
hadoop_AzureNativeFileSystemStore_getContainerFromAuthority_rdh | /**
* Method to extract the container name from an Azure URI.
*
* @param uri
* -- WASB blob URI
* @returns containerName -- the container name for the URI. May be null.
* @throws URISyntaxException
* if the uri does not have an authority it is badly formed.
*/
private String getContainerFromAuthority(URI ur... | 3.26 |
hadoop_AzureNativeFileSystemStore_isBlockBlobWithCompactionKey_rdh | /**
* Checks if the given key in Azure Storage should be stored as a block blobs
* with compaction enabled instead of normal block blob.
*
* @param key
* blob name
* @return true, if the file is in directory with block compaction enabled.
*/
public boolean isBlockBlobWithCompactionKey(String key) {
retur... | 3.26 |
hadoop_AzureNativeFileSystemStore_acquireLease_rdh | /**
* Get a lease on the blob identified by key. This lease will be renewed
* indefinitely by a background thread.
*/
@Override
public SelfRenewingLease acquireLease(String key) throws AzureException {
LOG.debug("acquiring lease on {}", key);
try {
checkContainer(ContainerAccessType.ReadThenWrite);
CloudBlobWrapper ... | 3.26 |
hadoop_AzureNativeFileSystemStore_getHTTPScheme_rdh | /**
* Get the appropriate return the appropriate scheme for communicating with
* Azure depending on whether wasb or wasbs is specified in the target URI.
*
* return scheme - HTTPS or HTTP as appropriate.
*/
private String getHTTPScheme() {
String sessionScheme = sessionUri.getScheme();
// Check if we're on... | 3.26 |
hadoop_AzureNativeFileSystemStore_changePermissionStatus_rdh | /**
* Changes the permission status on the given key.
*/
@Override
public void changePermissionStatus(String key, PermissionStatus newPermission) throws AzureException {
try {
checkContainer(ContainerAccessType.ReadThenWrite);
CloudBlobWrapper blob = getBlobReference(key);
blob.downloadAt... | 3.26 |
hadoop_AzureNativeFileSystemStore_getDataLength_rdh | /**
* Return the actual data length of the blob with the specified properties.
* If it is a page blob, you can't rely on the length from the properties
* argument and you must get it from the file. Otherwise, you can.
*/
private long getDataLength(CloudBlobWrapper blob, BlobProperties properties) throws AzureExcept... | 3.26 |
hadoop_AzureNativeFileSystemStore_safeDelete_rdh | /**
* Deletes the given blob, taking special care that if we get a
* blob-not-found exception upon retrying the operation, we just
* swallow the error since what most probably happened is that
* the first operation succeeded on the server.
*
* @param blob
* The blob to delete.
* @param lease
* Azure blob l... | 3.26 |
hadoop_AzureNativeFileSystemStore_getLinkInFileMetadata_rdh | /**
* If the blob with the given key exists and has a link in its metadata to a
* temporary file (see storeEmptyLinkFile), this method returns the key to
* that temporary file. Otherwise, returns null.
*/
@Override
public String getLinkInFileMetadata(String key) throws AzureException {
if (null == storageIntera... | 3.26 |
hadoop_AzureNativeFileSystemStore_trim_rdh | /**
* Trims a suffix/prefix from the given string. For example if
* s is given as "/xy" and toTrim is "/", this method returns "xy"
*/
private static String trim(String s, String toTrim) {
return StringUtils.removeEnd(StringUtils.removeStart(s, toTrim), toTrim);
} | 3.26 |
hadoop_AzureNativeFileSystemStore_defaultPermissionNoBlobMetadata_rdh | /**
* Default permission to use when no permission metadata is found.
*
* @return The default permission to use.
*/
private static PermissionStatus defaultPermissionNoBlobMetadata() {
return new PermissionStatus("", "", FsPermission.getDefault());
} | 3.26 |
hadoop_AzureNativeFileSystemStore_openOutputStream_rdh | /**
* Opens a new output stream to the given blob (page or block blob)
* to populate it from scratch with data.
*/
private OutputStream openOutputStream(final CloudBlobWrapper blob) throws StorageException {
if
(blob instanceof CloudPageBlobWrapper) {return new PageBlobOutputStream(((CloudPageBlobWrapper) (b... | 3.26 |
hadoop_AzureNativeFileSystemStore_verifyAndConvertToStandardFormat_rdh | /**
* Checks if the given rawDir belongs to this account/container, and
* if so returns the canonicalized path for it. Otherwise return null.
*/
private String verifyAndConvertToStandardFormat(String rawDir) throws URISyntaxException {
URI asUri = new URI(rawDir);
if ((asUri.getAuthority() == null) || asUri.... | 3.26 |
hadoop_AzureNativeFileSystemStore_normalizeKey_rdh | /**
* This private method normalizes the key by stripping the container name from
* the path and returns a path relative to the root directory of the
* container.
*
* @param directory
* - adjust the key to this directory to a path relative to the root
* directory
* @returns normKey
*/
private String normal... | 3.26 |
hadoop_AzureNativeFileSystemStore_configureAzureStorageSession_rdh | /**
* Set the configuration parameters for this client storage session with
* Azure.
*
* @throws AzureException
*/
private void configureAzureStorageSession() throws AzureException {// Assertion: Target session URI already should h... | 3.26 |
hadoop_AzureNativeFileSystemStore_connectUsingConnectionStringCredentials_rdh | /**
* Connect to Azure storage using account key credentials.
*/
private void connectUsingConnectionStringCredentials(final String accountName, final String containerName, final String accountKey) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
// If the account name is "acc.blob.... | 3.26 |
hadoop_AzureNativeFileSystemStore_openInputStream_rdh | /**
* Opens a new input stream for the given blob (page or block blob)
* to read its data.
*/
private InputStream openInputStream(CloudBlobWrapper blob, Optional<Configuration> options) throws StorageException, IOException {
if (blob
insta... | 3.26 |
hadoop_AzureNativeFileSystemStore_addTestHookToOperationContext_rdh | /**
* Add a test hook to modify the operation context we use for Azure Storage
* operations.
*
* @param testHook
* The test hook, or null to unset previous hooks.
*/
@VisibleForTesting
void addTestHookToOperationContext(TestHookOperationContext testHook) {
this.testHookOperationContext = testHook;
} | 3.26 |
hadoop_AzureNativeFileSystemStore_listRootBlobs_rdh | /**
* This private method uses the root directory or the original container to
* list blobs under the directory or container given a specified prefix for
* the directory depending on whether the original file system object was
* constructed with a short- or long-form URI. It also uses the specified flat
* or hiera... | 3.26 |
hadoop_AzureNativeFileSystemStore_connectUsingSASCredentials_rdh | /**
* Connect to Azure storage using shared access signature credentials.
*/
private void connectUsingSASCredentials(final String accountName, final String containerName, final String sas) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
StorageCredentials credentials = new Storag... | 3.26 |
hadoop_AzureNativeFileSystemStore_initialize_rdh | /**
* Method for the URI and configuration object necessary to create a storage
* session with an Azure session. It parses the scheme to ensure it matches
* the storage protocol supported by this file system.
*
* @param uri
* - URI for target storage blob.
* @param conf
* - reference to configuration object... | 3.26 |
hadoop_AzureNativeFileSystemStore_getAccountFromAuthority_rdh | /**
* Method to extract the account name from an Azure URI.
*
* @param uri
* -- WASB blob URI
* @returns accountName -- the account name for the URI.
* @throws URISyntaxException
* if the URI does not have an authority it is badly formed.
*/
private String getAccountFromAuthority(URI uri) throws URISyntaxEx... | 3.26 |
hadoop_AzureNativeFileSystemStore_createAzureStorageSession_rdh | /**
* Establish a session with Azure blob storage based on the target URI. The
* method determines whether or not the URI target contains an explicit
* account or an implicit default cluster-wide account.
*
* @throws AzureException
* @throws IOException
... | 3.26 |
hadoop_AzureNativeFileSystemStore_buildUpList_rdh | /**
* Build up a metadata list of blobs in an Azure blob directory. This method
* uses a in-order first traversal of blob directory structures to maintain
* the sorted order of the blob names.
*
* @param aCloudBlobDirectory
* Azure blob directory
* @param metadataHashMap
* a map of file metadata objects for... | 3.26 |
hadoop_AzureNativeFileSystemStore_createPermissionJsonSerializer_rdh | /**
* Creates a JSON serializer that can serialize a PermissionStatus object into
* the JSON string we want in the blob metadata.
*
* @return The JSON serializer.
*/
private static JSON createPermissionJsonSerializer() {
log.Log.getProperties().setProperty("org.eclipse.jetty.uti... | 3.26 |
hadoop_ZStandardCompressor_setInputFromSavedData_rdh | // copy enough data from userBuf to uncompressedDirectBuf
private void setInputFromSavedData() {
int len = Math.min(userBufLen, uncompressedDirectBuf.remaining());
uncompressedDirectBuf.put(userBuf, userBufOff, len);
userBufLen -= len;
userBufOff += len;
uncompressedDirectBufLen = uncompressedDirectBuf.position();
... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.