name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hadoop_TokenIdentifier_getBytes_rdh
/** * Get the bytes for the token identifier * * @return the bytes of the identifier */ public byte[] getBytes() { DataOutputBuffer buf = new DataOutputBuffer(4096); try { this.write(buf); } catch (IOException ie) { throw new RuntimeException("i/o error in getBytes", ie); } ...
3.26
hadoop_BinaryRecordInput_get_rdh
/** * Get a thread-local record input for the supplied DataInput. * * @param inp * data input stream * @return binary record input corresponding to the supplied DataInput. */ public static BinaryRecordInput get(DataInput inp) { BinaryRecordInput v0 = B_IN.get(); v0.setDataInput(inp); return v0; }
3.26
hadoop_WeakReferenceThreadMap_removeForCurrentThread_rdh
/** * Remove the reference for the current thread. * * @return any reference value which existed. */ public V removeForCurrentThread() { return remove(currentThreadId()); }
3.26
hadoop_WeakReferenceThreadMap_setForCurrentThread_rdh
/** * Set the new value for the current thread. * * @param newVal * new reference to set for the active thread. * @return the previously set value, possibly null */ public V setForCurrentThread(V newVal) { requireNonNull(newVal); long id = currentThreadId(); // if the same object is already in the m...
3.26
hadoop_WeakReferenceThreadMap_currentThreadId_rdh
/** * Get the current thread ID. * * @return thread ID. */ public long currentThreadId() { return Thread.currentThread().getId(); }
3.26
hadoop_WeakReferenceThreadMap_getForCurrentThread_rdh
/** * Get the value for the current thread, creating if needed. * * @return an instance. */ public V getForCurrentThread() { return get(currentThreadId()); }
3.26
hadoop_HsJobPage_content_rdh
/** * The content of this page is the JobBlock * * @return HsJobBlock.class */ @Override protected Class<? extends SubView> content() { return HsJobBlock.class; }
3.26
hadoop_HsJobPage_preHead_rdh
/* (non-Javadoc) @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ @Override protected void preHead(Page.HTML<__> html) { String jobID = $(JOB_ID); set(TITLE, jobID.isEmpty() ? "Bad request: missing job ID" : join("MapReduce Job ", $(JOB_ID)...
3.26
hadoop_RecurrenceId_getPipelineId_rdh
/** * Return the pipelineId for the pipeline jobs. * * @return the pipelineId. */ public final String getPipelineId() { return pipelineId; }
3.26
hadoop_RecurrenceId_getRunId_rdh
/** * Return the runId for the pipeline job in one run. * * @return the runId. */ public final String getRunId() { return runId; }
3.26
hadoop_CachingAuthorizer_get_rdh
/** * * @param key * - Cache key * @return null on cache-miss. true/false on cache-hit */ public V get(K key) { if (!isEnabled) {return null; } V result = cache.getIfPresent(key); if (result == null) {LOG.debug("{}: CACHE MISS: {}", label, key.toString()); } else { LOG.debug("{}: CAC...
3.26
hadoop_FederationRegistryClient_writeRegistry_rdh
/** * Write registry entry, override if exists. */ private void writeRegistry(final RegistryOperations registryImpl, UserGroupInformation ugi, final String key, final String value, final boolean throwIfFails) throws YarnException { final ServiceRecord recordValue = new ServiceRecord(); recordValue.descri...
3.26
hadoop_FederationRegistryClient_listDirRegistry_rdh
/** * List the sub directories in the given directory. */ private List<String> listDirRegistry(final RegistryOperations registryImpl, UserGroupInformation ugi, final String key, final boolean throwIfFails) throws YarnException { List<String> result = ugi.doAs(((PrivilegedAction<List<String>>) (() -> { tr...
3.26
hadoop_FederationRegistryClient_writeAMRMTokenForUAM_rdh
/** * Write/update the UAM token for an application and a sub-cluster. * * @param appId * ApplicationId. * @param subClusterId * sub-cluster id of the token * @param token * the UAM of the application * @return whether the amrmToken is added or updated to a new value */ public synchronized boolean wri...
3.26
hadoop_FederationRegistryClient_removeAppFromRegistry_rdh
/** * Remove an application from registry. * * @param appId * application id. */ public synchronized void removeAppFromRegistry(ApplicationId appId) { m0(appId, false); }
3.26
hadoop_FederationRegistryClient_cleanAllApplications_rdh
/** * For testing, delete all application records in registry. */ @VisibleForTesting public synchronized void cleanAllApplications() { try { removeKeyRegistry(this.registry, this.user, getRegistryKey(null, null), true, false); } catch (YarnException e) { LOG.warn("Unexpected exception from rem...
3.26
hadoop_FederationRegistryClient_getAllApplications_rdh
/** * Get the list of known applications in the registry. * * @return the list of known applications */public synchronized List<String> getAllApplications() { // Suppress the exception here because it is valid that the entry does not // exist List<String> applications = null;try { applications =...
3.26
hadoop_FederationRegistryClient_loadStateFromRegistry_rdh
/** * Load the information of one application from registry. * * @param appId * application id * @return the sub-cluster to UAM token mapping */ public synchronized Map<String, Token<AMRMTokenIdentifier>> loadStateFromRegistry(ApplicationId appId) { Map<String, Token<AMRMTokenIdentifier>> retMap = new Hash...
3.26
hadoop_RecordStore_getDriver_rdh
/** * Get the State Store driver. * * @return State Store driver. */ public StateStoreDriver getDriver() { return this.driver; } /** * Build a state store API implementation interface. * * @param clazz * The specific interface implementation to create * @param driver * The {@link StateStoreDriver}
3.26
hadoop_ActiveUsersManager_activateApplication_rdh
/** * An application has new outstanding requests. * * @param user * application user * @param applicationId * activated application */ @Lock({ Queue.class, SchedulerApplicationAttempt.class }) @Override public synchronized void activateApplication(String user, ApplicationId applicationId) { Set<Applicat...
3.26
hadoop_ActiveUsersManager_deactivateApplication_rdh
/** * An application has no more outstanding requests. * * @param user * application user * @param applicationId * deactivated application */ @Lock({ Queue.class, SchedulerApplicationAttempt.class }) @Override public synchronized void deactivateApplication(String user, ApplicationId applicationId) { Set<...
3.26
hadoop_ActiveUsersManager_getNumActiveUsers_rdh
/** * Get number of active users i.e. users with applications which have pending * resource requests. * * @return number of active users */ @Lock({ Queue.class, SchedulerApplicationAttempt.class }) @Override public synchronized int getNumActiveUsers() { return activeUsers; }
3.26
hadoop_AdlPermission_getAclBit_rdh
/** * Returns true if "adl.feature.support.acl.bit" configuration is set to * true. * * If configuration is not set then default value is true. * * @return If configuration is not set then default value is true. */ public boolean getAclBit() { return aclBit; }
3.26
hadoop_PlacementConstraintTransformations_transform_rdh
/** * This method performs the transformation of the * {@link #placementConstraint}. * * @return the transformed placement constraint. */ public PlacementConstraint transform() { AbstractConstraint constraintExpr = placementConstraint.getConstraintExpr(); // Visit the constraint tree to perform the tra...
3.26
hadoop_ReduceTaskAttemptInfo_getReduceRuntime_rdh
/** * Get the runtime for the <b>reduce</b> phase of the reduce task-attempt. * * @return the runtime for the <b>reduce</b> phase of the reduce task-attempt */ public long getReduceRuntime() { return reduceTime; }
3.26
hadoop_ReduceTaskAttemptInfo_getShuffleRuntime_rdh
/** * Get the runtime for the <b>shuffle</b> phase of the reduce task-attempt. * * @return the runtime for the <b>shuffle</b> phase of the reduce task-attempt */ public long getShuffleRuntime() { return shuffleTime; }
3.26
hadoop_ReduceTaskAttemptInfo_getMergeRuntime_rdh
/** * Get the runtime for the <b>merge</b> phase of the reduce task-attempt * * @return the runtime for the <b>merge</b> phase of the reduce task-attempt */ public long getMergeRuntime() { return mergeTime; }
3.26
hadoop_TypedBytesWritable_toString_rdh
/** * Generate a suitable string representation. */ public String toString() { return getValue().toString(); }
3.26
hadoop_TypedBytesWritable_getType_rdh
/** * Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if ((bytes == null) || (bytes.length == 0)) { return null; } for (Type type : Type.values()) { if (type.code == ((int) (bytes[0]))) { return typ...
3.26
hadoop_TypedBytesWritable_setValue_rdh
/** * Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); ...
3.26
hadoop_TypedBytesWritable_getValue_rdh
/** * Get the typed bytes as a Java object. */ public Object getValue() { try { ByteArrayInputStream bais = new ByteArrayInputStream(getBytes()); TypedBytesInput tbi = TypedBytesInput.get(new DataInputStream(bais)); Object obj = tbi.read(); return obj; } catch (IOExcep...
3.26
hadoop_WrappedMapper_getInputSplit_rdh
/** * Get the input split for this map. */ public InputSplit getInputSplit() { return mapContext.getInputSplit(); }
3.26
hadoop_WrappedMapper_getMapContext_rdh
/** * Get a wrapped {@link Mapper.Context} for custom implementations. * * @param mapContext * <code>MapContext</code> to be wrapped * @return a wrapped <code>Mapper.Context</code> for custom implementations */ public Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context getMapContext(MapContext<KEYIN, VALUEIN, KEYO...
3.26
hadoop_RehashPartitioner_getPartition_rdh
/** * Rehash {@link Object#hashCode()} to partition. */ public int getPartition(K key, V value, int numReduceTasks) { int h = SEED ^ key.hashCode(); h ^= (h >>> 20) ^ (h >>> 12); h = (h ^ (h >>> 7)) ^ (h >>> 4); return (h & Integer.MAX_VALUE) % numReduceTasks;}
3.26
hadoop_ApplicationRowKey_getRowKeyAsString_rdh
/** * Constructs a row key for the application table as follows: * {@code clusterId!userName!flowName!flowRunId!AppId}. * * @return String representation of row key. */ public String getRowKeyAsString() { return appRowKeyConverter.encodeAsString(this); }
3.26
hadoop_ApplicationRowKey_parseRowKey_rdh
/** * Given the raw row key as bytes, returns the row key as an object. * * @param rowKey * Byte representation of row key. * @return An <cite>ApplicationRowKey</cite> object. */ public static ApplicationRowKey parseRowKey(byte[] rowKey) { return new ApplicationRowKeyConverter().decode(rowKey); }
3.26
hadoop_ApplicationRowKey_parseRowKeyFromString_rdh
/** * Given the encoded row key as string, returns the row key as an object. * * @param encodedRowKey * String representation of row key. * @return A <cite>ApplicationRowKey</cite> object. */ public static ApplicationRowKey parseRowKeyFromString(String encodedRowKey) { return new ApplicationRowKeyConver...
3.26
hadoop_PersistentLongFile_writeFile_rdh
/** * Atomically write the given value to the given file, including fsyncing. * * @param file * destination file * @param val * value to write * @throws IOException * if the file cannot be written */ public static void writeFile(File file, long val) throws IOException { AtomicFileOutputStream fos = n...
3.26
hadoop_WritableFactories_getFactory_rdh
/** * Define a factory for a class. * * @param c * input c. * @return a factory for a class. */ public static WritableFactory getFactory(Class c) { return CLASS_TO_FACTORY.get(c); }
3.26
hadoop_WritableFactories_setFactory_rdh
/** * Define a factory for a class. * * @param c * input c. * @param factory * input factory. */ public static void setFactory(Class c, WritableFactory factory) { CLASS_TO_FACTORY.put(c, factory); }
3.26
hadoop_WritableFactories_newInstance_rdh
/** * Create a new instance of a class with a defined factory. * * @param c * input c. * @return a new instance of a class with a defined factory. */ public static Writable newInstance(Class<? extends Writable> c) { return newInstance(c, null); }
3.26
hadoop_AbfsPermission_valueOf_rdh
/** * Create a AbfsPermission from a abfs symbolic permission string * * @param abfsSymbolicPermission * e.g. "rw-rw-rw-+" / "rw-rw-rw-" * @return a permission object for the provided string representation */ public static AbfsPermission valueOf(final String abfsSymbolicPermission) { if (abfsSymbolicPermiss...
3.26
hadoop_RouterQuotaUpdateService_getMountTableStore_rdh
/** * Get mount table store management interface. * * @return MountTableStore instance. * @throws IOException */ private MountTableStore getMountTableStore() throws IOException { if (this.mountTableStore == null) { this.mountTableStore = router.getStateStore().getRegisteredRecordStore(MountTableStore....
3.26
hadoop_RouterQuotaUpdateService_getQuotaSetMountTables_rdh
/** * Get mount tables which quota was set. * During this time, the quota usage cache will also be updated by * quota manager: * 1. Stale paths (entries) will be removed. * 2. Existing entries will be overridden and updated. * * @return List of mount tables which quota was set. * @throws IOException */ private...
3.26
hadoop_RouterQuotaUpdateService_isQuotaSet_rdh
/** * Check if the quota was set in given MountTable. * * @param mountTable * Mount table entry. */ private boolean isQuotaSet(MountTable mountTable) { if (mountTable != null) {return this.quotaManager.isQuotaSet(mountTable.getQuota()); } return false; }
3.26
hadoop_RouterQuotaUpdateService_generateNewQuota_rdh
/** * Generate a new quota based on old quota and current quota usage value. * * @param oldQuota * Old quota stored in State Store. * @param currentQuotaUsage * Current quota usage value queried from * subcluster. * @return A new RouterQuotaUsage. */ private RouterQuotaUsage generateNewQuota(RouterQuotaU...
3.26
hadoop_RouterQuotaUpdateService_getMountTableEntries_rdh
/** * Get all the existing mount tables. * * @return List of mount tables. * @throws IOException */ private List<MountTable> getMountTableEntries() throws IOException { // scan mount tables from root path GetMountTableEntriesRequest v19 = GetMountTabl...
3.26
hadoop_TextView_echo_rdh
/** * Print strings escaping html. * * @param args * the strings to print */public void echo(Object... args) { PrintWriter out = writer(); for (Object v1 : args) { String escapedString = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(v1.toString())); out.print(escape...
3.26
hadoop_TextView_echoWithoutEscapeHtml_rdh
/** * Print strings as is (no newline, a la php echo). * * @param args * the strings to print */ public void echoWithoutEscapeHtml(Object... args) { PrintWriter out = writer(); for (Object s : args) { out.print(s); } }
3.26
hadoop_TextView_puts_rdh
/** * Print strings as a line (new line appended at the end, a la C/Tcl puts). * * @param args * the strings to print */ public void puts(Object... args) { echo(args); writer().println(); }
3.26
hadoop_TextView_putWithoutEscapeHtml_rdh
/** * Print string as a line. This does not escapes the string for html * * @param args * the strings to print */ public void putWithoutEscapeHtml(Object args) { echoWithoutEscapeHtml(args); writer().println(); }
3.26
hadoop_MountTableStore_updateCacheAllRouters_rdh
/** * Update mount table cache of this router as well as all other routers. */ protected void updateCacheAllRouters() { if (f0 != null) { try { f0.refresh(); } catch (StateStoreUnavailableException e) { LOG.error("Cannot refresh mount table: state store not available", e); } }}
3.26
hadoop_EntityIdentifier_getType_rdh
/** * Get the entity type. * * @return The entity type. */ public String getType() { return type;}
3.26
hadoop_PlanningAlgorithm_allocateUser_rdh
/** * Performs the actual allocation for a ReservationDefinition within a Plan. * * @param reservationId * the identifier of the reservation * @param user * the user who owns the reservation * @param plan * the Plan to which the reservation must be fitted * @param ...
3.26
hadoop_JobID_getJobIDsPattern_rdh
/** * Returns a regex pattern which matches task IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>any job</i> * run on the jobtracker started at <i>200707121733</i>, we would use : * <pre> * JobID.getTaskIDsPattern("200707121733"...
3.26
hadoop_JobID_m0_rdh
/** * Construct a JobId object from given string * * @return constructed JobId object or null if the given String is null * @throws IllegalArgumentException * if the given string is malformed */ public static JobID m0(String str) throws IllegalArgumentException { return ((JobID) (JobID.forName(str)));}
3.26
hadoop_JobID_downgrade_rdh
/** * Downgrade a new JobID to an old one * * @param old * a new or old JobID * @return either old or a new JobID build to match old */ public static JobID downgrade(JobID old) {if (old instanceof JobID) { return ((JobID) (old)); } else { return new JobID(old.getJtIdentifier(), old.getId());...
3.26
hadoop_ExcludePrivateAnnotationsStandardDoclet_languageVersion_rdh
/** * A <a href="http://java.sun.com/javase/6/docs/jdk/api/javadoc/doclet/">Doclet</a> * for excluding elements that are annotated with * {@link org.apache.hadoop.classification.InterfaceAudience.Private} or * {@link org.apache.hadoop.classification.InterfaceAudience.LimitedPrivate}. * It delegates to the Standard...
3.26
hadoop_BoundedByteArrayOutputStream_getBuffer_rdh
/** * Returns the underlying buffer. * Data is only valid to {@link #size()}. * * @return the underlying buffer. */ public byte[] getBuffer() { return buffer; }
3.26
hadoop_BoundedByteArrayOutputStream_getLimit_rdh
/** * Return the current limit. * * @return limit. */ public int getLimit() { return limit; }
3.26
hadoop_BoundedByteArrayOutputStream_size_rdh
/** * Returns the length of the valid data * currently in the buffer. * * @return the length of the valid data. */ public int size() { return currentPointer - startOffset; }
3.26
hadoop_BoundedByteArrayOutputStream_reset_rdh
/** * Reset the buffer */ public void reset() { this.limit = buffer.length - startOffset; this.currentPointer = startOffset; }
3.26
hadoop_BlockPoolTokenSecretManager_generateToken_rdh
/** * See {@link BlockTokenSecretManager#generateToken(ExtendedBlock, EnumSet, * StorageType[], String[])}. */ public Token<BlockTokenIdentifier> generateToken(ExtendedBlock b, EnumSet<AccessMode> of, StorageType[] storageTypes, String[] storageIds) throws IOException { return get(b.getBlockPoolId()).generateT...
3.26
hadoop_BlockPoolTokenSecretManager_createIdentifier_rdh
/** * Return an empty BlockTokenIdentifer */ @Override public BlockTokenIdentifier createIdentifier() { return new BlockTokenIdentifier(); }
3.26
hadoop_BlockPoolTokenSecretManager_checkAccess_rdh
/** * See {@link BlockTokenSecretManager#checkAccess(Token, String, * ExtendedBlock, BlockTokenIdentifier.AccessMode, * StorageType[], String[])} */ public void checkAccess(Token<BlockTokenIdentifier> token, String userId, ExtendedBlock block, AccessMode mode, StorageType[] storageTyp...
3.26
hadoop_BlockPoolTokenSecretManager_addKeys_rdh
/** * See {@link BlockTokenSecretManager#addKeys(ExportedBlockKeys)}. */ public void addKeys(String bpid, ExportedBlockKeys exportedKeys) throws IOException { get(bpid).addKeys(exportedKeys); }
3.26
hadoop_LeaveSafeModeRequest_newInstance_rdh
/** * API request for the Router leaving safe mode state and updating * its state in State Store. */public abstract class LeaveSafeModeRequest { public static LeaveSafeModeRequest newInstance() throws IOException { return StateStoreSerializer.newRecord(LeaveSafeModeRequest.class);}
3.26
hadoop_DockerCommand_getCommandOption_rdh
/** * Returns the docker sub-command string being used * e.g 'run'. */ public final String getCommandOption() { return this.command; }
3.26
hadoop_DockerCommand_preparePrivilegedOperation_rdh
/** * Prepare the privileged operation object that will be used to invoke * the container-executor. * * @param dockerCommand * Specific command to be run by docker. * @param containerName * @param env * @param nmContext * @return Returns the PrivilegedOperation object to be used. * @throws ContainerExecutio...
3.26
hadoop_DockerCommand_addCommandArguments_rdh
/** * Add command commandWithArguments - this method is only meant for use by * sub-classes. * * @param key * name of the key to be added * @param value * value of the key */ protected final void addCommandArguments(String key, String value) { List<String> list = commandArguments.get(key); if (list...
3.26
hadoop_DockerCommand_setClientConfigDir_rdh
/** * Add the client configuration directory to the docker command. * * The client configuration option proceeds any of the docker subcommands * (such as run, load, pull, etc). Ordering will be handled by * container-executor. Docker expects the value to be a directory containing * the file config.json. This file...
3.26
hadoop_GetGroupsBase_getUgmProtocol_rdh
/** * Get a client of the {@link GetUserMappingsProtocol}. * * @return A {@link GetUserMappingsProtocol} client proxy. * @throws IOException * raised on errors performing I/O. */protected GetUserMappingsProtocol getUgmProtocol() throws IOException { GetUserMappingsProtocol userGroupMappingProtocol = RPC.get...
3.26
hadoop_PathOutputCommitterFactory_createFileOutputCommitter_rdh
/** * Create an instance of the default committer, a {@link FileOutputCommitter} * for a task. * * @param outputPath * the task's output path, or or null if no output path * has been defined. * @param context * the task attempt context * @return the committer to use * @throws IOException * problems i...
3.26
hadoop_PathOutputCommitterFactory_createOutputCommitter_rdh
/** * Create an output committer for a task attempt. * * @param outputPath * output path. This may be null. * @param context * context * @return a new committer * @throws IOException * problems instantiating the committer */ public PathOutputCommitter createOutputCommitter(Path outputPath, TaskAttempt...
3.26
hadoop_PathOutputCommitterFactory_getCommitterFactory_rdh
/** * Get the committer factory for a configuration. * * @param outputPath * the job's output path. If null, it means that the * schema is unknown and a per-schema factory cannot be determined. * @param conf * configuration * @return an instantiated committer factory */ public static PathOutputCommitterF...
3.26
hadoop_Endpoint_clone_rdh
/** * Shallow clone: the lists of addresses are shared * * @return a cloned instance * @throws CloneNotSupportedException */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
3.26
hadoop_Endpoint_m0_rdh
/** * Create a new address structure of the requested size * * @param size * size to create * @return the new list */ private List<Map<String, String>> m0(int size) { return new ArrayList<Map<String, String>>(size); }
3.26
hadoop_Endpoint_validate_rdh
/** * Validate the record by checking for null fields and other invalid * conditions * * @throws NullPointerException * if a field is null when it * MUST be set. * @throws RuntimeException * on invalid entries */ public void validate() { Preconditions.checkNotNull(api, "null API field"); Precondi...
3.26
hadoop_StopContainersRequest_m0_rdh
/** * <p>The request sent by the <code>ApplicationMaster</code> to the * <code>NodeManager</code> to <em>stop</em> containers.</p> * * @see ContainerManagementProtocol#stopContainers(StopContainersRequest) */ @Public @Stablepublic abstract class StopContainersRequest { @Public @Stable public static Sto...
3.26
hadoop_SaveTaskManifestStage_executeStage_rdh
/** * Save the manifest to a temp file and rename to the final * manifest destination. * * @param manifest * manifest * @return the path to the final entry * @throws IOException * IO failure. */ @Override protected Path executeStage(final TaskManifest manifest) throws IOException { final Path manifestD...
3.26
hadoop_SaveSuccessFileStage_getStageName_rdh
/** * Stage name is always job commit. * * @param arguments * args to the invocation. * @return stage name */ @Override protected String getStageName(ManifestSuccessData arguments) { // set it to the job commit stage, always. return OP_STAGE_JOB_COMMIT; }
3.26
hadoop_OBSCommonUtils_blockRootDelete_rdh
/** * Reject any request to delete an object where the key is root. * * @param bucket * bucket name * @param key * key to validate * @throws InvalidRequestException * if the request was rejected due to a * mistaken attempt to delete the root * directory. */ static void blockRootDelete(final String ...
3.26
hadoop_OBSCommonUtils_translateException_rdh
/** * Translate an exception raised in an operation into an IOException. The * specific type of IOException depends on the class of {@link ObsException} * passed in, and any status codes included in the operation. That is: HTTP * error codes are examined and can be used to build a more specific * response. * * @...
3.26
hadoop_OBSCommonUtils_getBucketFsStatus_rdh
/** * Get the fs status of the bucket. * * @param obs * OBS client instance * @param bucketName * bucket name * @return boolean value indicating if this bucket is a posix bucket * @throws FileNotFoundException * the bucket is absent * @throws IOException * any other problem talking to OBS */ static ...
3.26
hadoop_OBSCommonUtils_longOption_rdh
/** * Get a long option not smaller than the minimum allowed value. * * @param conf * configuration * @param key * key to look up * @param defVal * default value * @param min * minimum value * @return the value * @throws IllegalArgumentException * if the value is below the minimum */ static long...
3.26
hadoop_OBSCommonUtils_toLocatedFileStatus_rdh
/** * Build a {@link LocatedFileStatus} from a {@link FileStatus} instance. * * @param owner * the owner OBSFileSystem instance * @param status * file status * @return a located status with block locations set up from this FS. * @throws IOException * IO Problems. */ static LocatedFileStatus toLocatedFil...
3.26
hadoop_OBSCommonUtils_maybeAddTrailingSlash_rdh
/** * Turns a path (relative or otherwise) into an OBS key, adding a trailing "/" * if the path is not the root <i>and</i> does not already have a "/" at the * end. * * @param key * obs key or "" * @return the with a trailing "/", or, if it is the root key, "", */ static String maybeAddTrailingSlash(final Str...
3.26
hadoop_OBSCommonUtils_innerListStatus_rdh
/** * List the statuses of the files/directories in the given path if the path is * a directory. * * @param owner * the owner OBSFileSystem instance * @param f * given path * @param recursive * flag indicating if list is recursive * @return the statuses of the files/directories in the given patch * @th...
3.26
hadoop_OBSCommonUtils_verifyBucketExists_rdh
/** * Verify that the bucket exists. This does not check permissions, not even * read access. * * @param owner * the owner OBSFileSystem instance * @throws FileNotFoundException * the bucket is absent * @throws IOException * any other problem talking to OBS */ static void verifyBucketExists(final OBSFil...
3.26
hadoop_OBSCommonUtils_deleteObjects_rdh
/** * Perform a bulk object delete operation. Increments the {@code OBJECT_DELETE_REQUESTS} and write operation statistics. * * @param owner * the owner OBSFileSystem instance * @param deleteRequest * keys to delete on the obs...
3.26
hadoop_OBSCommonUtils_getMultipartSizeProperty_rdh
/** * Get a size property from the configuration: this property must be at least * equal to {@link OBSConstants#MULTIPART_MIN_SIZE}. If it is too small, it is * rounded up to that minimum, and a warning printed. * * @param conf * configuration * @param property * property name * @param defVal * default ...
3.26
hadoop_OBSCommonUtils_newAppendFileRequest_rdh
/** * Create a appendFile request. Adds the ACL and metadata * * @param owner * the owner OBSFileSystem instance * @param key * key of object * @param tmpFile * temp file or input stream * @param recordPosition * client record next append position * @return the request * @throws IOException * any...
3.26
hadoop_OBSCommonUtils_extractException_rdh
/** * Extract an exception from a failed future, and convert to an IOE. * * @param operation * operation which failed * @param path * path operated on (may be null) * @param ee * execution exception * @return an IOE which can be thrown */ static IOException extractException(final String operation, final...
3.26
hadoop_OBSCommonUtils_putObjectDirect_rdh
/** * PUT an object directly (i.e. not via the transfer manager). Byte length is * calculated from the file length, or, if there is no file, from the content * length of the header. <i>Important: this call will close any input stream * in the request.</i> * * @param owner * the owner OBSFileSystem instance * ...
3.26
hadoop_OBSCommonUtils_m3_rdh
/** * Propagates bucket-specific settings into generic OBS configuration keys. * This is done by propagating the values of the form {@code fs.obs.bucket.${bucket}.key} to {@code fs.obs.key}, for all values of "key" * other than a small set of unmodifiable values. * * <p>The source of the updated property is set to...
3.26
hadoop_OBSCommonUtils_innerIsFolderEmpty_rdh
// Used to check if a folder is empty or not. static boolean innerIsFolderEmpty(final OBSFileSystem owner, final String key) throws FileNotFoundException, ObsException { String obsKey = maybeAddTrailingSlash(key); ListObjectsRequest request = new ListObjectsRequest(); request.setBucketName(owner.getBucket...
3.26
hadoop_OBSCommonUtils_qualify_rdh
/** * Qualify a path. * * @param owner * the owner OBSFileSystem instance * @param path * path to qualify * @return a qualified path. */ static Path qualify(final OBSFileSystem owner, final Path path) { return path.makeQualified(owner.getUri(), owner.getWorkingDirectory()); }
3.26
hadoop_OBSCommonUtils_maybeAddBeginningSlash_rdh
/** * Add obs key started '/'. * * @param key * object key * @return new key */ static String maybeAddBeginningSlash(final String key) { return (!StringUtils.isEmpty(key)) && (!key.startsWith("/")) ? "/" + key : key; }
3.26
hadoop_OBSCommonUtils_patchSecurityCredentialProviders_rdh
/** * Patch the security credential provider information in {@link #CREDENTIAL_PROVIDER_PATH} with the providers listed in {@link OBSConstants#OBS_SECURITY_CREDENTIAL_PROVIDER_PATH}. * * <p>This allows different buckets to use different credential files. * * @param conf * configuration to patch */ static void ...
3.26
hadoop_OBSCommonUtils_lookupPassword_rdh
/** * Get a password from a configuration/configured credential providers. * * @param conf * configuration * @param key * key to look up * @return a password or the value in {@code defVal} * @throws IOException * on any problem */ private static String lookupPassword(final Configuration conf, final Stri...
3.26