name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_ContainerContext_getContainerType_rdh | /**
* Get {@link ContainerType} the type of the container
* being initialized or stopped.
*
* @return the type of the container
*/
public ContainerType getContainerType() {
return containerType;
} | 3.26 |
hadoop_ContainerContext_getResource_rdh | /**
* Get {@link Resource} the resource capability allocated to the container
* being initialized or stopped.
*
* @return the resource capability.
*/
public Resource getResource() {
return resource;
} | 3.26 |
hadoop_ContainerContext_getContainerId_rdh | /**
* Get {@link ContainerId} of the container being initialized or stopped.
*
* @return the container ID
*/
public ContainerId getContainerId() {
return containerId;
} | 3.26 |
hadoop_UploadHandle_toByteArray_rdh | /**
*
* @return Serialized from in bytes.
*/
default byte[] toByteArray() {
ByteBuffer bb = bytes();
byte[] ret = new byte[bb.remaining()];
bb.get(ret);
return ret;
} | 3.26 |
hadoop_LongValueSum_getReport_rdh | /**
*
* @return the string representation of the aggregated value
*/
public String getReport() {return "" + sum;
} | 3.26 |
hadoop_LongValueSum_addNextValue_rdh | /**
* add a value to the aggregator
*
* @param val
* a long value.
*/
public void addNextValue(long val) {
this.sum += val;
} | 3.26 |
hadoop_LongValueSum_reset_rdh | /**
* reset the aggregator
*/
public void reset() {
sum = 0;
} | 3.26 |
hadoop_LongValueSum_getSum_rdh | /**
*
* @return the aggregated value
*/
public long getSum() {
return this.sum;
} | 3.26 |
hadoop_ApplicationColumnPrefix_getColumnPrefix_rdh | /**
*
* @return the column name value
*/
private String getColumnPrefix() {
return columnPrefix;
} | 3.26 |
hadoop_V2Migration_v1RequestHandlersUsed_rdh | /**
* Notes use of request handlers.
*
* @param handlers
* handlers declared
*/
public static void v1RequestHandlersUsed(final String handlers) {
WARN_OF_REQUEST_HANDLERS.warn("Ignoring V1 SDK request handlers set in {}: {}", AUDIT_REQUEST_HANDLERS, handlers);
} | 3.26 |
hadoop_AuditReplayThread_getException_rdh | /**
* Get the Exception that caused this thread to stop running, if any, else
* null. Should not be called until this thread has already completed (i.e.,
* after {@link #join()} has been called).
*
* @return The exception which was thrown, if any.
*/
Exception getException()
{
return exception;
} | 3.26 |
hadoop_AuditReplayThread_addToQueue_rdh | /**
* Add a command to this thread's processing queue.
*
* @param cmd
* Command to add.
*/
void addToQueue(AuditReplayCommand cmd) {
commandQueue.put(cmd);
} | 3.26 |
hadoop_AuditReplayThread_drainCounters_rdh | /**
* Merge all of this thread's counter values into the counters contained
* within the passed context.
*
* @param context
* The context holding the counters to increment.
*/
void drainCounters(Mapper.Context context) {
for (Map.Entry<REPLAYCOUNTERS, Counter> ent :
repl... | 3.26 |
hadoop_GlobPattern_hasWildcard_rdh | /**
*
* @return true if this is a wildcard pattern (with special chars)
*/
public boolean hasWildcard() {
return hasWildcard;
} | 3.26 |
hadoop_GlobPattern_compiled_rdh | /**
*
* @return the compiled pattern
*/
public Pattern compiled() {
return compiled;
} | 3.26 |
hadoop_GlobPattern_compile_rdh | /**
* Compile glob pattern string
*
* @param globPattern
* the glob pattern
* @return the pattern object
*/
public static Pattern compile(String globPattern) {
return
new GlobPattern(globPattern).compiled();
} | 3.26 |
hadoop_GlobPattern_set_rdh | /**
* Set and compile a glob pattern
*
* @param glob
* the glob pattern string
*/
public void set(String glob) {
StringBuilder regex = new StringBuilder();
int setOpen = 0;
int v2
= 0;int len = glob.length();
hasWildcard = false;
for ... | 3.26 |
hadoop_GlobPattern_matches_rdh | /**
* Match input against the compiled glob pattern
*
* @param s
* input chars
* @return true for successful matches
*/
public boolean matches(CharSequence s) {
return compiled.matcher(s).matches();
} | 3.26 |
hadoop_StateStoreUtils_getHostPortString_rdh | /**
* Returns address in form of host:port, empty string if address is null.
*
* @param address
* address
* @return host:port
*/
public static String getHostPortString(InetSocketAddress address) {
if (null == address) {
return "";
}
String hostName = address.getHostName();
if (hostName.equals("0.0.0.0")) {... | 3.26 |
hadoop_StateStoreUtils_getRecordClass_rdh | /**
* Get the base class for a record. If we get an implementation of a record we
* will return the real parent record class.
*
* @param <T>
* Type of the class of the data record.
* @param record
* Record to check its main class.
* @return Base class for the record.
*/
public static <T extends BaseRecord>... | 3.26 |
hadoop_StateStoreUtils_getRecordName_rdh | /**
* Get the base class name for a record. If we get an implementation of a
* record we will return the real parent record class.
*
* @param <T>
* Type of the class of the data record.
* @param clazz
* Class of the data record to check.
* @return Name of the base class for the record.
*/
public static <T ... | 3.26 |
hadoop_OneSidedPentomino_main_rdh | /**
* Solve the 3x30 puzzle.
*
* @param args
*/
public static void main(String[] args) {
Pentomino model = new OneSidedPentomino(3, 30);
int solutions = model.solve();
System.out.println(solutions + " solutions found.");
} | 3.26 |
hadoop_OneSidedPentomino_initializePieces_rdh | /**
* Define the one sided pieces. The flipped pieces have the same name with
* a capital letter.
*/
protected void initializePieces() {
pieces.add(new Piece("x", " x /xxx/ x ", false, oneRotation));
pieces.add(new Piece("v", "x /x /xxx", false, fourRotations));
pieces.add(new Piece("t", "xxx/ x / x ",... | 3.26 |
hadoop_PlacementConstraints_minCardinality_rdh | /**
* Similar to {@link #minCardinality(String, int, String...)}, but let you
* attach a namespace to the allocation tags.
*
* @param scope
* the scope of the constraint
* @param namespace
* the namespace of these tags
* @param minCardinality
* determines the minimum number of allocations within
* the... | 3.26 |
hadoop_PlacementConstraints_targetNotIn_rdh | /**
* Creates a constraint that requires allocations to be placed on nodes that
* belong to a scope (e.g., node or rack) that does not satisfy any of the
* target expressions.
*
* @param scope
* the scope within which the target expressions should not be
* true
* @param targetExpressions
* the expression... | 3.26 |
hadoop_PlacementConstraints_targetNodeAttribute_rdh | /**
* Creates a constraint that requires allocations to be placed on nodes that
* belong to a scope (e.g., node or rack) that satisfy any of the
* target expressions based on node attribute op code.
*
* @param scope
* the scope within which the target expressions should not be
* true
* @param opCode
* No... | 3.26 |
hadoop_PlacementConstraints_maxCardinality_rdh | /**
* Similar to {@link #maxCardinality(String, int, String...)}, but let you
* specify a namespace for the tags, see supported namespaces in
* {@link AllocationTagNamespaceType}.
*
* @param scope
* the scope of the constraint
* @param tagNamespace
* the namespace of these tags
* @param maxCardinality
* ... | 3.26 |
hadoop_PlacementConstraints_targetIn_rdh | /**
* Creates a constraint that requires allocations to be placed on nodes that
* satisfy all target expressions within the given scope (e.g., node or rack).
*
* For example, {@code targetIn(RACK, allocationTag("hbase-m"))}, allows
* allocations on nodes that belong to a rack that has at least one tag with
* valu... | 3.26 |
hadoop_PlacementConstraints_cardinality_rdh | /**
* Similar to {@link #cardinality(String, int, int, String...)}, but let you
* attach a namespace to the given allocation tags.
*
* @param scope
* the scope of the constraint
* @param namespace
* the namespace of the allocation tags
* @param minCardinality
* determines the minimum number of allocation... | 3.26 |
hadoop_PlacementConstraints_allocationTagWithNamespace_rdh | /**
* Constructs a target expression on a set of allocation tags under
* a certain namespace.
*
* @param namespace
* namespace of the allocation tags
* @param allocationTags
* allocation tags
* @return a target expression
*/
public static TargetExpression allocationTagWithNamespace(String namespace, String... | 3.26 |
hadoop_PlacementConstraints_build_rdh | /**
* Creates a {@link PlacementConstraint} given a constraint expression.
*
* @param constraintExpr
* the constraint expression
* @return the placement constraint
*/
public static PlacementConstraint build(AbstractConstraint constraintExpr) {
return constraintExpr.build();
} | 3.26 |
hadoop_PlacementConstraints_or_rdh | /**
* A disjunction of constraints.
*
* @param children
* the children constraints, one of which should be satisfied
* @return the resulting placement constraint
*/
public static Or or(AbstractConstraint... children) {
return new Or(children);
} | 3.26 |
hadoop_PlacementConstraints_targetCardinality_rdh | /**
* This constraint generalizes the cardinality and target constraints.
*
* Consider a set of nodes N that belongs to the scope specified in the
* constraint. If the target expressions are satisfied at least minCardinality
* times and at most maxCardinality times in the node set N, then t... | 3.26 |
hadoop_PlacementConstraints_delayedOr_rdh | /**
* Creates a composite constraint that includes a list of timed placement
* constraints. The scheduler should try to satisfy first the first timed
* child constraint within the specified time window. If this is not possible,
* it should attempt to satisfy the second, and so on.
*
* @param children
* the tim... | 3.26 |
hadoop_PlacementConstraints_and_rdh | // Creation of compound constraints.
/**
* A conjunction of constraints.
*
* @param children
* the children constraints that should all be satisfied
* @return the resulting placement constraint
*/
public static And and(AbstractConstraint... children) {
return new And(children);
} | 3.26 |
hadoop_PlacementConstraints_timedClockConstraint_rdh | // Creation of timed constraints to be used in a DELAYED_OR constraint.
/**
* Creates a placement constraint that has to be satisfied within a time
* window.
*
* @param constraint
* the placement constraint
* @param delay
* the length of the time window within which the constraint has
* to be satisfied
*... | 3.26 |
hadoop_PlacementConstraints_nodeAttribute_rdh | /**
* Constructs a target expression on a node attribute. It is satisfied if
* the specified node attribute has one of the specified values.
*
* @param attributeKey
* the name of the node attribute
* @param attributeValues
* the set of values that the attribute should take
* values from
* @return the res... | 3.26 |
hadoop_PlacementConstraints_timedOpportunitiesConstraint_rdh | /**
* Creates a placement constraint that has to be satisfied within a number of
* placement opportunities (invocations of the scheduler).
*
* @param constraint
* the placement constraint
* @param delay
* the number of scheduling opportunities within which the
* constraint has to be satisfied
* @return t... | 3.26 |
hadoop_PlacementConstraints_nodePartition_rdh | /**
* Constructs a target expression on a node partition. It is satisfied if
* the specified node partition has one of the specified nodePartitions.
*
* @param nodePartitions
* the set of values that the attribute should take
* values from
* @return the resulting expression on... | 3.26 |
hadoop_ReplayJobFactory_start_rdh | /**
* Start the reader thread, wait for latch if necessary.
*/
@Override
public void start() {
this.rThread.start();
} | 3.26 |
hadoop_ReplayJobFactory_update_rdh | /**
*
* @param item
*/
public void
update(Statistics.ClusterStats item) {
} | 3.26 |
hadoop_DockerCommandExecutor_getContainerStatus_rdh | /**
* Get the status of the docker container. This runs a docker inspect to
* get the status. If the container no longer exists, docker inspect throws
* an exception and the nonexistent status is returned.
*
* @param containerId
* the id of the container.
* @param privilegedOperationExecutor
* the privilege... | 3.26 |
hadoop_DockerCommandExecutor_executeDockerCommand_rdh | /**
* Execute a docker command and return the output.
*
* @param dockerCommand
* the docker command to run.
* @param containerId
* the id of the container.
* @param env
* environment for the container.
* @param privilegedOperationExecutor
* the privileged op... | 3.26 |
hadoop_DockerCommandExecutor_isStoppable_rdh | /**
* Is the container in a stoppable state?
*
* @param containerStatus
* the container's {@link DockerContainerStatus}.
* @return is the container in a stoppable state.
*/
public static boolean isStoppable(DockerContainerStatus containerStatus) {
if (containerStatus.equals(DockerContainerStatus.RUNNING) || con... | 3.26 |
hadoop_DockerCommandExecutor_executeStatusCommand_rdh | /**
* Execute the docker inspect command to retrieve the docker container's
* status.
*
* @param containerId
* the id of the container.
* @param privilegedOperationExecutor
* the privileged operations executor.
* @return the current container status.
* @throws ContainerExecutionException
* if the docker... | 3.26 |
hadoop_DockerCommandExecutor_isKillable_rdh | /**
* Is the container in a killable state?
*
* @param containerStatus
* the container's {@link DockerContainerStatus}.
* @return is the container in a killable state.
*/
public static boolean isKillable(DockerContainerStatus containerStatus) {
return isStoppable(containerStatus);}
/**
* Is the container in ... | 3.26 |
hadoop_DockerCommandExecutor_isStartable_rdh | /**
* Is the container in a startable state?
*
* @param containerStatus
* the container's {@link DockerContainerStatus}.
* @return is the container in a startable state.
*/
public static boolean isStartable(DockerContainerStatus containerStatus) {
if (containerStatus.equals(DockerContainerStatus.EXITED) || cont... | 3.26 |
hadoop_DockerCommandExecutor_parseContainerStatus_rdh | /**
* Parses the container status string.
*
* @param containerStatusStr
* container status.
* @return a {@link DockerContainerStatus} representing the status.
*/
public static DockerContainerStatus parseContainerStatus(String containerStatusStr) {
DockerContainerStatus dockerContainerStatus;
if (containerStat... | 3.26 |
hadoop_SerialJobFactory_start_rdh | /**
* Start the reader thread, wait for latch if necessary.
*/
@Override
public void start() {
LOG.info(" Starting Serial submission ");
this.rThread.start(); } | 3.26 |
hadoop_SerialJobFactory_update_rdh | /**
* SERIAL. Once you get notification from StatsCollector about the job
* completion ,simply notify the waiting thread.
*
* @param item
*/
@Override
public void update(Statistics.JobStats item) {
// simply notify in case of serial submissions. We are just bothered
// if submitted job is completed or n... | 3.26 |
hadoop_SerialJobFactory_setDistCacheEmulator_rdh | // it is need for test
void setDistCacheEmulator(DistributedCacheEmulator e) {
jobCreator.setDistCacheEmulator(e);
} | 3.26 |
hadoop_SerialJobFactory_run_rdh | /**
* SERIAL : In this scenario . method waits on notification ,
* that a submitted job is actually completed. Logic is simple.
* ===
* while(true) {
* wait till previousjob is completed.
* break;
* }
* submit newJob.
* previousJo... | 3.26 |
hadoop_AbfsClient_checkUserError_rdh | /**
* Returns true if the status code lies in the range of user error.
*
* @param responseStatusCode
* http response status code.
* @return True or False.
*/
private boolean checkUserError(int responseStatusCode) {
return (responseStatusCode >= HttpURLConnection.HTTP_BAD_REQUEST) && (responseStatusCode < H... | 3.26 |
hadoop_AbfsClient_renameIdempotencyCheckOp_rdh | /**
* Check if the rename request failure is post a retry and if earlier rename
* request might have succeeded at back-end.
*
* If a source etag was passed in, and the error was 404, get the
* etag of any file at the destination.
* If it matches the source etag, then the rename is considered
* a success.
* Exce... | 3.26 |
hadoop_AbfsClient_deleteIdempotencyCheckOp_rdh | /**
* Check if the delete request failure is post a retry and if delete failure
* qualifies to be a success response assuming idempotency.
*
* There are below scenarios where delete could be incorrectly deducted as
* success post request retry:
* 1. Target was originally not existing and initial delete request ha... | 3.26 |
hadoop_AbfsClient_getAbfsRestOperation_rdh | /**
* Creates an AbfsRestOperation with parameters including request headers and SAS token.
*
* @param operationType
* The type of the operation.
* @param httpMethod
* The HTTP method of the operation.
* @param url
* The URL associated with the operation.
* @param requestHeaders
* The list of HTTP hea... | 3.26 |
hadoop_AbfsClient_appendSASTokenToQuery_rdh | /**
* If configured for SAS AuthType, appends SAS token to queryBuilder.
*
* @param path
* @param operation
* @param queryBuilder
* @param cachedSasToken
* - previously acquired SAS token to be reused.
* @return sasToken - returned for optional re-use.
* @throws SASTokenProviderException
*/
private String a... | 3.26 |
hadoop_AbfsClient_getAbfsCounters_rdh | /**
* Getter for abfsCounters from AbfsClient.
*
* @return AbfsCounters instance.
*/
protected AbfsCounters getAbfsCounters() {
return abfsCounters;
} | 3.26 |
hadoop_AbfsClient_m5_rdh | /**
* Creates an AbfsRestOperation with additional parameters for buffer and SAS token.
*
* @param operationType
* The type of the operation.
* @param httpMethod
* The HTTP method of the operation.
* @param url
* The URL associated with the operation.
* @param requestHeaders
* The list of HTTP headers... | 3.26 |
hadoop_AbfsClient_checkAccess_rdh | /**
* Talks to the server to check whether the permission specified in
* the rwx parameter is present for the path specified in the path parameter.
*
* @param path
* Path for which access check needs to be performed
* @param rwx
* The permission to be checked on the path
* @param tracingContext
* Tracks ... | 3.26 |
hadoop_AbfsClient_appendSuccessCheckOp_rdh | // For AppendBlob its possible that the append succeeded in the backend but the request failed.
// However a retry would fail with an InvalidQueryParameterValue
// (as the current offset would be unacceptable).
// Hence, we pass/succeed the appendblob append call
// in case we are doing a retry after checking the lengt... | 3.26 |
hadoop_AbfsClient_getDirectoryQueryParameter_rdh | /**
* Get the directory query parameter used by the List Paths REST API and used
* as the path in the continuation token. If the input path is null or the
* root path "/", empty string is returned. If the input path begins with '/',
* the return value is the substring beginning at offset 1. Otherwise, the
* inpu... | 3.26 |
hadoop_AbfsClient_getAbfsConfiguration_rdh | /**
* Getter for abfsConfiguration from AbfsClient.
*
* @return AbfsConfiguration instance
*/
protected AbfsConfiguration getAbfsConfiguration() {
return abfsConfiguration;
} | 3.26 |
hadoop_RefreshMountTableEntriesRequest_newInstance_rdh | /**
* API request for refreshing mount table cached entries from state store.
*/public abstract class RefreshMountTableEntriesRequest {
public static RefreshMountTableEntriesRequest newInstance() throws IOException {
return StateStoreSerializer.newRecord(RefreshMountTableEntriesRequest.class);
} | 3.26 |
hadoop_SubmitterUserResolver_needsTargetUsersList_rdh | /**
* {@inheritDoc }
* <p>
* Since {@link SubmitterUserResolver} returns the user name who is running
* gridmix, it doesn't need a target list of users.
*/
public boolean needsTargetUsersList() {
return false;
} | 3.26 |
hadoop_ReleaseContainerEvent_getContainer_rdh | /**
* Get RMContainer.
*
* @return RMContainer.
*/
public RMContainer getContainer() {
return container;
} | 3.26 |
hadoop_CoderUtil_getEmptyChunk_rdh | /**
* Make sure to return an empty chunk buffer for the desired length.
*
* @param leastLength
* @return empty chunk of zero bytes
*/
static byte[] getEmptyChunk(int leastLength) {
if (emptyChunk.length >=
leastLength) {
return emptyChunk;// In most time
}
synchronized(CoderUtil.class) {
... | 3.26 |
hadoop_CoderUtil_toBuffers_rdh | /**
* Convert an array of this chunks to an array of ByteBuffers
*
* @param chunks
* chunks to convertToByteArrayState into buffers
* @return an array of ByteBuffers
*/static ByteBuffer[] toBuffers(ECChunk[] chunks) {
... | 3.26 |
hadoop_CoderUtil_resetBuffer_rdh | /**
* Ensure the buffer (either input or output) ready to read or write with ZERO
* bytes fully in specified length of len.
*
* @param buffer
* bytes array buffer
* @return the buffer itself
*/
static byte[] resetBuffer(byte[] buffer, int offset, int len) {
byte[] empty = getEmptyChunk(len);System.arraycop... | 3.26 |
hadoop_CoderUtil_findFirstValidInput_rdh | /**
* Find the valid input from all the inputs.
*
* @param inputs
* input buffers to look for valid input
* @return the first valid input
*/
static <T> T findFirstValidInput(T[] inputs) {
for (T input : inputs)
{
if (input != null) {
return input;
}
}
throw new Hadoo... | 3.26 |
hadoop_CoderUtil_getNullIndexes_rdh | /**
* Get indexes array for items marked as null, either erased or
* not to read.
*
* @return indexes array
*/
static <T> int[] getNullIndexes(T[] inputs) {
int[] nullIndexes = new int[inputs.length];
int idx = 0;
for (int i = 0; i
< inputs.length; i++) {
if (inputs[i] == null) {
... | 3.26 |
hadoop_CoderUtil_resetOutputBuffers_rdh | /**
* Initialize the output buffers with ZERO bytes.
*/static void resetOutputBuffers(byte[][] buffers, int[] offsets, int dataLen) {
for (int i = 0; i < buffers.length; i++) {
resetBuffer(buffers[i], offsets[i], dataLen);
}
} | 3.26 |
hadoop_CoderUtil_getValidIndexes_rdh | /**
* Picking up indexes of valid inputs.
*
* @param inputs
* decoding input buffers
* @param <T>
*/
static <T> int[] getValidIndexes(T[] inputs) {
int[] validIndexes = new int[inputs.length];
int idx = 0;for (int i = 0; i < inputs.length; i++) {if (inputs[i] != null) {
validIndexes[idx++] =... | 3.26 |
hadoop_StorageUnit_multiply_rdh | /**
* Using BigDecimal so we can throw if we are overflowing the Long.Max.
*
* @param first
* - First Num.
* @param second
* - Second Num.
* @return Returns a double
*/
private static double multiply(double first, double second) {
BigDecimal firstVal = new BigDecimal(first);
BigDecimal v3 = new BigD... | 3.26 |
hadoop_StorageUnit_divide_rdh | /**
* Using BigDecimal to avoid issues with overflow and underflow.
*
* @param value
* - value
* @param divisor
* - divisor.
* @return -- returns a double that represents this value
*/
private static double divide(double value, double divisor) {
BigDecimal val = new BigDecimal(value);
BigDecimal bDi... | 3.26 |
hadoop_VolumeFailureInfo_getEstimatedCapacityLost_rdh | /**
* Returns estimate of capacity lost. This is said to be an estimate, because
* in some cases it's impossible to know the capacity of the volume, such as if
* we never had a chance to query its capacity before the failure occurred.
*
* @return estimate of capacity lost in bytes
*/
public long getEstimatedCapa... | 3.26 |
hadoop_VolumeFailureInfo_getFailedStorageLocation_rdh | /**
* Returns the storage location that has failed.
*
* @return storage location that has failed
*/public StorageLocation getFailedStorageLocation() {
return this.failedStorageLocation;
} | 3.26 |
hadoop_ECPolicyLoader_loadECPolicies_rdh | /**
* Load EC policies from a XML configuration file.
*
* @param policyFile
* EC policy file
* @return list of EC policies
* @throws ParserConfigurationException
* if ParserConfigurationException happen
* @throws IOException
* if no such EC policy file
* @thro... | 3.26 |
hadoop_ECPolicyLoader_loadPolicy_rdh | /**
* Load a EC policy from a policy element in the XML configuration file.
*
* @param element
* EC policy element
* @param schemas
* all valid schemas of the EC policy file
* @return EC policy
*/
private ErasureCodingPolicy loadPolicy(Element element, Map<String, ECSchema> schemas) {
NodeList fields = ... | 3.26 |
hadoop_ECPolicyLoader_loadSchema_rdh | /**
* Load a schema from a schema element in the XML configuration file.
*
* @param element
* EC schema element
* @return ECSchema
*/
private ECSchema loadSchema(Element element) {
Map<String, String> schemaOptions = new HashMap<String, String>();
NodeList fields = element.getChildNodes();
for (int ... | 3.26 |
hadoop_ECPolicyLoader_loadSchemas_rdh | /**
* Load schemas from root element in the XML configuration file.
*
* @param root
* root element
* @return EC schema map
*/
private Map<String, ECSchema> loadSchemas(Element root) {
NodeList elements = root.getElementsByTagName("schemas").item(0).getChildNodes();
Map<String, ECSchema> schemas = new H... | 3.26 |
hadoop_ECPolicyLoader_getPolicyFile_rdh | /**
* Path to the XML file containing user defined EC policies. If the path is
* relative, it is searched for in the classpath.
*
* @param policyFilePath
* path of EC policy file
* @return EC policy file
*/
private File getPolicyFile(String policyFilePath) throws MalformedURLException {
File policyFile = n... | 3.26 |
hadoop_ECPolicyLoader_loadLayoutVersion_rdh | /**
* Load layoutVersion from root element in the XML configuration file.
*
* @param root
* root element
* @return layout version
*/
private int loadLayoutVersion(Element root) {
int layoutVersion;
Text text = ((Text) (root.getElementsByTagName("layoutversion").item(0).getFirstChild()));
if (text !... | 3.26 |
hadoop_FutureDataInputStreamBuilder_withFileStatus_rdh | /**
* A FileStatus may be provided to the open request.
* It is up to the implementation whether to use this or not.
*
* @param status
* status: may be null
* @return the builder.
*/
default FutureDataInputStreamBuilder withFileStatus(@Nullable
FileStatus status) {
return this;
} | 3.26 |
hadoop_RouterDelegationTokenSecretManager_getTokenByRouterStoreToken_rdh | /**
* Get RMDelegationTokenIdentifier according to RouterStoreToken.
*
* @param identifier
* RMDelegationTokenIdentifier
* @return RMDelegationTokenIdentifier
* @throws YarnException
* An internal conversion error occurred when getting the Token
* @throws IOException
* IO exception occurred
*/
public RM... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_removeStoredToken_rdh | /**
* The Router Supports Remove Token.
*
* @param identifier
* Delegation Token
* @throws IOException
* IO exception occurred.
*/
@Override public void removeStoredToken(RMDelegationTokenIdentifier identifier) throws IOException {
try {
federationFacade.removeStoredToken(identifier);
} catch (Exception e) {... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_updateStoredToken_rdh | /**
* The Router Supports Update Token.
*
* @param identifier
* RMDelegationToken.
* @param tokenInfo
* DelegationTokenInformation.
*/
public void updateStoredToken(RMDelegationTokenIdentifier identifier, DelegationTokenInformation tokenInfo) {
try {
long v2 = tokenInfo.getRenewDate();
String token = Rou... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_removeStoredMasterKey_rdh | /**
* The Router Supports Remove the master key.
* During this Process, Facade will call the specific StateStore to remove the MasterKey.
*
* @param delegationKey
* DelegationKey
*/
@Overridepublic void removeStoredMasterKey(DelegationKey delegationKey) {
try {
federationFacade.removeStoredMasterKey... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_storeNewMasterKey_rdh | /**
* The Router Supports Store the New Master Key.
* During this Process, Facade will call the specific StateStore to store the MasterKey.
*
* @param newKey
* DelegationKey
*/
@Override
public void storeNewMasterKey(DelegationKey newKey) {
try {
federationFacade.storeNewMasterKey(newKey);
} c... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_storeNewToken_rdh | /**
* The Router Supports Store new Token.
*
* @param identifier
* RMDelegationToken.
* @param tokenInfo
* DelegationTokenInformation.
*/
public void storeNewToken(RMDelegationTokenIdentifier identifier, DelegationTokenInformation tokenInfo)
{
try {
String token = RouterDelegationTokenSupport.enc... | 3.26 |
hadoop_RouterDelegationTokenSecretManager_getMasterKeyByDelegationKey_rdh | /**
* The Router supports obtaining the DelegationKey stored in the Router StateStote
* according to the DelegationKey.
*
* @param key
* Param DelegationKey
* @return Delegation Token
* @throws YarnException
* An internal conversion error occurred when getting the Token
* @throws IOException
* IO except... | 3.26 |
hadoop_AclEntryType_toStringStable_rdh | /**
* Returns a string representation guaranteed to be stable across versions to
* satisfy backward compatibility requirements, such as for shell command
* output or serialization.
*
* @return stable, backward compatible string representation
*/
public String toStringStable() {
// The base implementation uses... | 3.26 |
hadoop_ProtocolProxy_getProxy_rdh | /* Get the proxy */
public T getProxy() {
return proxy;
} | 3.26 |
hadoop_ProtocolProxy_isMethodSupported_rdh | /**
* Check if a method is supported by the server or not.
*
* @param methodName
* a method's name in String format
* @param parameterTypes
* a method's parameter types
* @return true if the method is supported by the server
* @throws IOException
* raised on errors performing I/O.
*/
public synchronized... | 3.26 |
hadoop_AbfsOutputStream_getActiveBlock_rdh | /**
* Synchronized accessor to the active block.
*
* @return the active block; null if there isn't one.
*/
private synchronized DataBlock getActiveBlock() {
return activeBlock;
} | 3.26 |
hadoop_AbfsOutputStream_failureWhileSubmit_rdh | /**
* A method to set the lastError if an exception is caught.
*
* @param ex
* Exception caught.
* @throws IOException
* Throws the lastError.
*/
private void failureWhileSubmit(Exception ex) throws IOException {
if (ex instanceof AbfsRestOperationException) {
if (((Ab... | 3.26 |
hadoop_AbfsOutputStream_getWriteOperationsSize_rdh | /**
* Getter to get the size of the task queue.
*
* @return the number of writeOperations in AbfsOutputStream.
*/
@VisibleForTestingpublic int getWriteOperationsSize() {
return writeOperations.size();
} | 3.26 |
hadoop_AbfsOutputStream_hasActiveBlock_rdh | /**
* Predicate to query whether or not there is an active block.
*
* @return true if there is an active block.
*/
private synchronized boolean hasActiveBlock() {
return activeBlock != null;} | 3.26 |
hadoop_AbfsOutputStream_hasActiveBlockDataToUpload_rdh | /**
* Is there an active block and is there any data in it to upload?
*
* @return true if there is some data to upload in an active block else false.
*/
private boolean hasActiveBlockDataToUpload() {
return hasActiveBlock() && getActiveBlock().hasData();
} | 3.26 |
hadoop_AbfsOutputStream_hasCapability_rdh | /**
* Query the stream for a specific capability.
*
* @param capability
* string to query the stream support for.
* @return true for hsync and hflush.
*/
@Override
public boolean hasCapability(String capability) {
return supportFlush && isProbeForSyncable(capability);
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.