name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_WordMedian_reduce_rdh | /**
* Sums all the individual values within the iterator and writes them to the
* same key.
*
* @param key
* This will be a length of a word that was read.
* @param values
* This will be an iterator of all the values associated with that
* key.
*/
public void reduce(IntWritable key, Iterable<IntWritable>... | 3.26 |
hadoop_WordMedian_readAndFindMedian_rdh | /**
* This is a standard program to read and find a median value based on a file
* of word counts such as: 1 456, 2 132, 3 56... Where the first values are
* the word lengths and the following values are the number of times that
* words of that length appear.
*
* @param path
* The path to read the HDFS file fr... | 3.26 |
hadoop_AbstractQueueCapacityCalculator_getResourceNames_rdh | /**
* Returns all resource names that are defined for a capacity type.
*
* @param queue
* queue for which the capacity vector is defined
* @param label
* node label
* @param capacityType
* capacity type for which the resource names are defined
* @return resource names
*/
protected Set<String> getResourc... | 3.26 |
hadoop_SnappyCompressor_setDictionary_rdh | /**
* Does nothing.
*/
@Override
public void setDictionary(byte[] b, int off, int len) {
// do nothing
} | 3.26 |
hadoop_SnappyCompressor_end_rdh | /**
* Closes the compressor and discards any unprocessed input.
*/@Override
public void end() {
} | 3.26 |
hadoop_SnappyCompressor_getBytesRead_rdh | /**
* Return number of bytes given to this compressor since last reset.
*/
@Override
public long getBytesRead() {return bytesRead;
} | 3.26 |
hadoop_SnappyCompressor_reset_rdh | /**
* Resets compressor so that a new set of input data can be processed.
*/
@Override
public void reset() {
finish = false;
finished = false;
uncompressedDirectBuf.clear();
uncompressedDirectBufLen = 0;
compressedDirectBuf.clear();
compressedDirectBuf.limit(0);
f1 = userBufLen
= 0;
... | 3.26 |
hadoop_SnappyCompressor_reinit_rdh | /**
* Prepare the compressor to be used in a new stream with settings defined in
* the given Configuration
*
* @param conf
* Configuration from which new setting are fetched
*/
@Override
public void reinit(Configuration conf) {
reset();
} | 3.26 |
hadoop_SnappyCompressor_m0_rdh | /**
* Sets input data for compression.
* This should be called whenever #needsInput() returns
* <code>true</code> indicating that more input data is required.
*
* @param b
* Input data
* @param off
* Start offset
* @param len
* Length
*/
@Override
public void m0(byte[] b, int off, int len) {
if (b
... | 3.26 |
hadoop_SnappyCompressor_finish_rdh | /**
* When called, indicates that compression should end
* with the current contents of the input buffer.
*/
@Override
public void finish() {
finish = true;
} | 3.26 |
hadoop_SnappyCompressor_compress_rdh | /**
* Fills specified buffer with compressed data. Returns actual number
* of bytes of compressed data. A return value of 0 indicates that
* needsInput() should be called in order to determine if more input
* data is required.
*
* @param b
* Buffer for the compressed data
* @param off
* Start offset of the... | 3.26 |
hadoop_SnappyCompressor_setInputFromSavedData_rdh | /**
* If a write would exceed the capacity of the direct buffers, it is set
* aside to be loaded by this function while the compressed data are
* consumed.
*/
void setInputFromSavedData() {
if (0 >= userBufLen) {
return;
} finished = false;
uncompressedDirectBufLen = Math... | 3.26 |
hadoop_SnappyCompressor_getBytesWritten_rdh | /**
* Return number of bytes consumed by callers of compress since last reset.
*/
@Override
public long getBytesWritten() {
return bytesWritten;
} | 3.26 |
hadoop_SchedulerNodeReport_getNumContainers_rdh | /**
*
* @return the number of containers currently running on this node.
*/
public int getNumContainers() {
return num;
} | 3.26 |
hadoop_SchedulerNodeReport_getUtilization_rdh | /**
*
* @return utilization of this node
*/
public ResourceUtilization getUtilization() {
return utilization;
} | 3.26 |
hadoop_SchedulerNodeReport_m0_rdh | /**
*
* @return the amount of resources currently available on the node
*/
public Resource m0() {
return avail;
} | 3.26 |
hadoop_SchedulerNodeReport_getUsedResource_rdh | /**
*
* @return the amount of resources currently used by the node.
*/
public Resource getUsedResource() {
return used;} | 3.26 |
hadoop_Time_formatTime_rdh | /**
* Convert time in millisecond to human readable format.
*
* @param millis
* millisecond.
* @return a human readable string for the input time
*/
public static String formatTime(long millis) {
return DATE_FORMAT.get().format(millis);
} | 3.26 |
hadoop_Time_now_rdh | /**
* Current system time. Do not use this to calculate a duration or interval
* to sleep, because it will be broken by settimeofday. Instead, use
* monotonicNow.
*
* @return current time in msec.
*/
public static long now() {
return System.currentTimeMillis();
} | 3.26 |
hadoop_Time_getUtcTime_rdh | /**
* Get the current UTC time in milliseconds.
*
* @return the current UTC time in milliseconds.
*/
public static long getUtcTime() {
return Calendar.getInstance(UTC_ZONE).getTimeInMillis();} | 3.26 |
hadoop_Time_monotonicNowNanos_rdh | /**
* Same as {@link #monotonicNow()} but returns its result in nanoseconds.
* Note that this is subject to the same resolution constraints as
* {@link System#nanoTime()}.
*
* @return a monotonic clock that counts in nanoseconds.
*/
public static long monotonicNowNanos() {return System.nanoTime();
} | 3.26 |
hadoop_Time_m0_rdh | /**
* Current time from some arbitrary time base in the past, counting in
* milliseconds, and not affected by settimeofday or similar system clock
* changes. This is appropriate to use when computing how much longer to
* wait for an interval to expire.
* This function can return a negative... | 3.26 |
hadoop_FutureIOSupport_propagateOptions_rdh | /**
* Propagate options to any builder.
* {@link FutureIO#propagateOptions(FSBuilder, Configuration, String, boolean)}
*
* @param builder
* builder to modify
* @param conf
* configuration to read
* @param prefix
* prefix to scan/strip
* @param mandatory
* are the options to be mandatory or optional?
... | 3.26 |
hadoop_FutureIOSupport_eval_rdh | /**
* Evaluate a CallableRaisingIOE in the current thread,
* converting IOEs to RTEs and propagating.
* See {@link FutureIO#eval(CallableRaisingIOE)}.
*
* @param callable
* callable to invoke
* @param <T>
* Return type.
* @return the evaluated result.
* @throws UnsupportedOperationException
* fail fast... | 3.26 |
hadoop_FutureIOSupport_awaitFuture_rdh | /**
* Given a future, evaluate it. Raised exceptions are
* extracted and handled.
* See {@link FutureIO#awaitFuture(Future, long, TimeUnit)}.
*
* @param future
* future to evaluate
* @param <T>
* type of the result.
* @param timeout
* timeout.
* @param unit
* unit.
* @return the result, if all went... | 3.26 |
hadoop_FutureIOSupport_raiseInnerCause_rdh | /**
* Extract the cause of a completion failure and rethrow it if an IOE
* or RTE.
* See {@link FutureIO#raiseInnerCause(CompletionException)}.
*
* @param e
* exception.
* @param <T>
* type of return value.
* @return nothing, ever.
* @throws IOException
* either the inner IOException, or a wrapper arou... | 3.26 |
hadoop_RemoteParam_getParameterForContext_rdh | /**
* Determine the appropriate value for this parameter based on the location.
*
* @param context
* Context identifying the location.
* @return A parameter specific to this location.
*/
public Object getParameterForContext(RemoteLocationContext context) {
if (context == null) {return null;
} else if (t... | 3.26 |
hadoop_ClientMmap_m0_rdh | /**
* Close the ClientMmap object.
*/
@Override
public void m0() {
if (replica != null) {
if (anchored) {
replica.removeNoChecksumAnchor();
}
replica.unref();
}
replica = null;
} | 3.26 |
hadoop_Server_getName_rdh | /**
* Returns the name of the server.
*
* @return the server name.
*/
public String getName() {
return name;
} | 3.26 |
hadoop_Server_getLogDir_rdh | /**
* Returns the server log dir.
*
* @return the server log dir.
*/
public String getLogDir() {
return logDir;
} | 3.26 |
hadoop_Server_destroy_rdh | /**
* Destroys the server.
* <p>
* All services are destroyed in reverse order of initialization, then the
* Log4j framework is shutdown.
*/
public void destroy() {
ensureOperational();
destroyServices();
log.info("Server [{}] shutdown!", name);
log.info("===========================================... | 3.26 |
hadoop_Server_getConfigDir_rdh | /**
* Returns the server config dir.
*
* @return the server config dir.
*/
public String getConfigDir() {
return configDir;
} | 3.26 |
hadoop_Server_init_rdh | /**
* Initializes the Server.
* <p>
* The initialization steps are:
* <ul>
* <li>It verifies the service home and temp directories exist</li>
* <li>Loads the Server <code>#SERVER#-default.xml</code>
* configuration file from the classpath</li>
* <li>Initializes log4j logging. If the
* <code>#SERVER#-log4j.prop... | 3.26 |
hadoop_Server_verifyDir_rdh | /**
* Verifies the specified directory exists.
*
* @param dir
* directory to verify it exists.
* @throws ServerException
* thrown if the directory does not exist or it the
* path it is not a directory.
*/
private void verifyDir(String dir) throws ServerException {
File file = new File(dir);
if (... | 3.26 |
hadoop_Server_destroyServices_rdh | /**
* Destroys the server services.
*/
protected void destroyServices() {
List<Service> list = new ArrayList<Service>(services.values());
Collections.reverse(list);
for (Service service : list) {
try {
log.debug("Destroying service [{}]", service.getInterface());
service.... | 3.26 |
hadoop_Server_getStatus_rdh | /**
* Returns the current server status.
*
* @return the current server status.
*/
public Status getStatus() {
return status;
} | 3.26 |
hadoop_Server_ensureOperational_rdh | /**
* Verifies the server is operational.
*
* @throws IllegalStateException
* thrown if the server is not operational.
*/
protected void ensureOperational() {
if (!getStatus().isOperational()) {
throw new IllegalStateException("Server is not running");
}
} | 3.26 |
hadoop_Server_initServices_rdh | /**
* Initializes the list of services.
*
* @param services
* services to initialized, it must be a de-dupped list of
* services.
* @throws ServerException
* thrown if the services could not be initialized.
*/
protected void initServices(List<Service> services) throws ServerException {
for (Service se... | 3.26 |
hadoop_Server_getHomeDir_rdh | /**
* Returns the server home dir.
*
* @return the server home dir.
*/
public String getHomeDir() {
return homeDir;
} | 3.26 |
hadoop_Server_setService_rdh | /**
* Adds a service programmatically.
* <p>
* If a service with the same interface exists, it will be destroyed and
* removed before the given one is initialized and added.
* <p>
* If an exception is thrown the server is destroyed.
*
* @param klass
* service class to add.
* @throws ServerException
* thr... | 3.26 |
hadoop_Server_getTempDir_rdh | /**
* Returns the server temp dir.
*
* @return the server temp dir.
*/
public String getTempDir() {
return tempDir;
} | 3.26 |
hadoop_Server_checkAbsolutePath_rdh | /**
* Validates that the specified value is an absolute path (starts with '/').
*
* @param value
* value to verify it is an absolute path.
* @param name
* name to use in the exception if the value is not an absolute
* path.
* @return the value.
* @throws IllegalArgumentException
* thrown if the value ... | 3.26 |
hadoop_Server_get_rdh | /**
* Returns the {@link Service} associated to the specified interface.
*
* @param serviceKlass
* service interface.
* @return the service implementation.
*/
@SuppressWarnings("unchecked")
public <T> T get(Class<T> serviceKlass) {
ensureOperational();Check.notNull(serviceKlass, "serviceKlass");
return... | 3.26 |
hadoop_Server_loadServices_rdh | /**
* Loads services defined in <code>services</code> and
* <code>services.ext</code> and de-dups them.
*
* @return List of final services to initialize.
* @throws ServerException
* throw if the services could not be loaded.
*/
protected List<Service> loadServices() throws ServerException {
try {
M... | 3.26 |
hadoop_Server_getPrefixedName_rdh | /**
* Returns the prefixed name of a server property.
*
* @param name
* of the property.
* @return prefixed name of the property.
*/public String getPrefixedName(String name) {
return (getPrefix() + ".") + Check.notEmpty(name, "name");
} | 3.26 |
hadoop_Server_initConfig_rdh | /**
* Loads and inializes the server configuration.
*
* @throws ServerException
* thrown if the configuration could not be loaded/initialized.
*/
protected void initConfig() throws ServerException {
verifyDir(con... | 3.26 |
hadoop_Server_getPrefix_rdh | /**
* Returns the server prefix for server configuration properties.
* <p>
* By default it is the server name.
*
* @return the prefix for server configuration properties.
*/
public String getPrefix() {
return getName();
} | 3.26 |
hadoop_Server_getConfig_rdh | /**
* Returns the server configuration.
*
* @return the server configuration.
*/
public Configuration getConfig() {
return config;
} | 3.26 |
hadoop_Server_setStatus_rdh | /**
* Sets a new server status.
* <p>
* The status must be settable.
* <p>
* All services will be notified o the status change via the
* {@link Service#serverStatusChange(Server.Status, Server.Status)} method. If a service
* throws an exception during the notification, the server will be destroyed.
*
* @param ... | 3.26 |
hadoop_Server_isOperational_rdh | /**
* Returns if this server status is operational.
*
* @return if this server status is operational.
*/
public boolean isOperational() {
return operational;
} | 3.26 |
hadoop_Event_getReplication_rdh | /**
* Replication is zero if the CreateEvent iNodeType is directory or symlink.
*/
public int getReplication() {
return f0;
} | 3.26 |
hadoop_Event_m0_rdh | /**
* The size of the closed file in bytes. May be -1 if the size is not
* available (e.g. in the case of a close generated by a concat operation).
*/
public long m0() {
return fileSize;
} | 3.26 |
hadoop_Event_getCtime_rdh | /**
* Creation time of the file, directory, or symlink.
*/
public long getCtime() {
return ctime;
} | 3.26 |
hadoop_Event_getSymlinkTarget_rdh | /**
* Symlink target is null if the CreateEvent iNodeType is not symlink.
*/
public String getSymlinkTarget() {
return symlinkTarget;
} | 3.26 |
hadoop_Event_isxAttrsRemoved_rdh | /**
* Whether the xAttrs returned by getxAttrs() were removed (as opposed to
* added).
*/
public boolean isxAttrsRemoved() {return xAttrsRemoved;
} | 3.26 |
hadoop_Event_getTimestamp_rdh | /**
* The time when this event occurred, in milliseconds since the epoch.
*/
public long getTimestamp() {
return timestamp;
} | 3.26 |
hadoop_Event_getAcls_rdh | /**
* The full set of ACLs currently associated with this file or directory.
* May be null if all ACLs were removed.
*/
public List<AclEntry> getAcls() {
return acls;
} | 3.26 |
hadoop_AbfsDelegationTokenManager_close_rdh | /**
* Close.
* If the token manager is closeable, it has its {@link Closeable#close()}
* method (quietly) invoked.
*/
@Override
public void close() {
if (tokenManager instanceof Closeable) {
IOUtils.cleanupWithLogger(LOG, ((Closeable) (tokenManager)));
}
} | 3.26 |
hadoop_AbfsDelegationTokenManager_getDelegationToken_rdh | /**
* Get a delegation token by invoking
* {@link CustomDelegationTokenManager#getDelegationToken(String)}.
* If the token returned already has a Kind; that is used.
* If not, then the token kind is set to
* {@link AbfsDelegationTokenIdentifier#TOKEN_KIND}, which implicitly
* resets any token renewer class.
*
*... | 3.26 |
hadoop_AbfsDelegationTokenManager_bind_rdh | /**
* Bind to a filesystem instance by passing the binding information down
* to any token manager which implements {@link BoundDTExtension}.
*
* This is not invoked before renew or cancel operations, but is guaranteed
* to be invoked before calls to {@link #getDelegationToken(String)}.
*
* @param fsURI
* URI... | 3.26 |
hadoop_DirectoryStagingCommitter_preCommitJob_rdh | /**
* Pre-commit actions for a job.
* Here: look at the conflict resolution mode and choose
* an action based on the current policy.
*
* @param commitContext
* commit context
* @param pending
* pending commits
* @throws IOExcep... | 3.26 |
hadoop_RegistryTypeUtils_validateServiceRecord_rdh | /**
* Validate the record by checking for null fields and other invalid
* conditions
*
* @param path
* path for exceptions
* @param record
* record to validate. May be null
* @throws InvalidRecordException
* on invalid entries
*/
public static void validateServiceRecord(String path, ServiceRecord rec... | 3.26 |
hadoop_RegistryTypeUtils_getAddressField_rdh | /**
* Get a specific field from an address -raising an exception if
* the field is not present
*
* @param address
* address to query
* @param field
* field to resolve
* @return the resolved value. Guaranteed to be non-null.
* @throws InvalidRecordException
* if the field did not resolve
*/
public stati... | 3.26 |
hadoop_RegistryTypeUtils_ipcEndpoint_rdh | /**
* Create an IPC endpoint
*
* @param api
* API
* @param address
* the address as a tuple of (hostname, port)
* @return the new endpoint
*/
public static Endpoint ipcEndpoint(String api, InetSocketAddress address) {
return new Endpoint(api, ADDRESS_HOSTNAME_AND_PORT, ProtocolTypes.PROTOCOL_HADOOP_IPC,... | 3.26 |
hadoop_RegistryTypeUtils_validateEndpoint_rdh | /**
* Validate the endpoint by checking for null fields and other invalid
* conditions
*
* @param path
* path for exceptions
* @param endpoint
* endpoint to validate. May be null
* @throws InvalidRecordException
* on invalid entries
*/
public static void v... | 3.26 |
hadoop_RegistryTypeUtils_requireAddressType_rdh | /**
* Require a specific address type on an endpoint
*
* @param required
* required type
* @param epr
* endpoint
* @throws InvalidRecordException
* if the type is wrong
*/
public static void requireAddressType(String required, Endpoint epr) throws InvalidRecordException {
if (!required.equals(epr.ad... | 3.26 |
hadoop_RegistryTypeUtils_uri_rdh | /**
* Create a URI
*
* @param uri
* value
* @return a 1 entry map.
*/
public static Map<String, String> uri(String uri) {
return map(ADDRESS_URI, uri);
} | 3.26 |
hadoop_RegistryTypeUtils_hostnamePortPair_rdh | /**
* Create a (hostname, port) address pair
*
* @param address
* socket address whose hostname and port are used for the
* generated address.
* @return a 1 entry map.
*/
public static Map<String, String> hostnamePortPair(InetSocketAddress address) {
return hostnamePortPair(address.getHostName(), address... | 3.26 |
hadoop_RegistryTypeUtils_restEndpoint_rdh | /**
* Create a REST endpoint from a list of URIs
*
* @param api
* implemented API
* @param uris
* URIs
* @return a new endpoint
*/
public static Endpoint restEndpoint(String api, URI... uris) {
return urlEndpoint(api, ProtocolTypes.PROTOCOL_REST, uris);
} | 3.26 |
hadoop_RegistryTypeUtils_webEndpoint_rdh | /**
* Create a Web UI endpoint from a list of URIs
*
* @param api
* implemented API
* @param uris
* URIs
* @return a new endpoint
*/
public static Endpoint webEndpoint(String api, URI... uris) {
return urlEndpoint(api, ProtocolTypes.PROTOCOL_WEBUI, uris);
} | 3.26 |
hadoop_RegistryTypeUtils_map_rdh | /**
* Create a single entry map
*
* @param key
* map entry key
* @param val
* map entry value
* @return a 1 entry map.
*/
public static Map<String, String> map(String key, String val) {
Map<String, String> map = new HashMap<String, String>(1);
map.put(key, val);
return map;
} | 3.26 |
hadoop_RegistryTypeUtils_retrieveAddressURLs_rdh | /**
* Get the address URLs. Guranteed to return at least one address.
*
* @param epr
* endpoint
* @return the address as a URL
* @throws InvalidRecordException
* if the type is wrong, there are no addresses
* or the payload ill-formatted
* @throws MalformedURLException
* address can't be turned into a... | 3.26 |
hadoop_RecoverPausedContainerLaunch_m0_rdh | /**
* Cleanup the paused container by issuing a kill on it.
*/
@SuppressWarnings("unchecked")
@Override
public Integer m0() {
int retCode = ExitCode.LOST.getExitCode();
ContainerId containerId = container.getContainerId();
String appIdStr = containerId.getApplicationAttemptId().getApplicationId().toString... | 3.26 |
hadoop_LoggedTask_incorporateCounters_rdh | // incorporate event counters
// LoggedTask MUST KNOW ITS TYPE BEFORE THIS CALL
public void incorporateCounters(JhCounters counters) {
switch (taskType) {
case MAP :
incorporateMapCounters(counters);
return;
case REDUCE :
incorporateReduceCounters(counters);
return;
// NOT exhaustive
}
} | 3.26 |
hadoop_LoggedTask_setUnknownAttribute_rdh | // for input parameter ignored.
@JsonAnySetter
public void setUnknownAttribute(String attributeName, Object ignored) {
if (!alreadySeenAnySetterAttributes.contains(attributeName)) {
alreadySeenAnySetterAttributes.add(attributeName);
System.err.println(("In LoggedJob, we saw the unknown attribute " +... | 3.26 |
hadoop_SnappyCodec_getDefaultExtension_rdh | /**
* Get the default filename extension for this kind of compression.
*
* @return <code>.snappy</code>.
*/
@Override
public String getDefaultExtension() {
return CodecConstants.SNAPPY_CODEC_EXTENSION;
} | 3.26 |
hadoop_SnappyCodec_setConf_rdh | /**
* Set the configuration to be used by this object.
*
* @param conf
* the configuration object.
*/
@Override
public void setConf(Configuration conf) {
this.conf = conf;
} | 3.26 |
hadoop_SnappyCodec_createCompressor_rdh | /**
* Create a new {@link Compressor} for use by this {@link CompressionCodec}.
*
* @return a new compressor for use by this codec
*/
@Override
public Compressor createCompressor() {
int bufferSize = conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY, CommonConfigurationKeys.IO_COMPR... | 3.26 |
hadoop_SnappyCodec_createDecompressor_rdh | /**
* Create a new {@link Decompressor} for use by this {@link CompressionCodec}.
*
* @return a new decompressor for use by this codec
*/
@Override
public Decompressor createDecompressor() {
int bufferSize = conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY, CommonConfigurationKeys.IO_... | 3.26 |
hadoop_SnappyCodec_getConf_rdh | /**
* Return the configuration used by this object.
*
* @return the configuration object used by this objec.
*/
@Override
public Configuration getConf() {
return conf;
} | 3.26 |
hadoop_SnappyCodec_createInputStream_rdh | /**
* Create a {@link CompressionInputStream} that will read from the given
* {@link InputStream} with the given {@link Decompressor}.
*
* @param in
* the stream to read compressed bytes from
* @param decompressor
* decompressor to use
* @return a stream to read uncompres... | 3.26 |
hadoop_SnappyCodec_getDecompressorType_rdh | /**
* Get the type of {@link Decompressor} needed by this {@link CompressionCodec}.
*
* @return the type of decompressor needed by this codec.
*/
@Override
public Class<? extends Decompressor> getDecompressorType() {
return SnappyDecompressor.class;
} | 3.26 |
hadoop_SnappyCodec_m0_rdh | /**
* Get the type of {@link Compressor} needed by this {@link CompressionCodec}.
*
* @return the type of compressor needed by this codec.
*/ @Override
public Class<? extends Compressor> m0() {
return SnappyCompressor.class;
} | 3.26 |
hadoop_SnappyCodec_createOutputStream_rdh | /**
* Create a {@link CompressionOutputStream} that will write to the given
* {@link OutputStream} with the given {@link Compressor}.
*
* @param out
* the location for the final output stream
* @param compressor
* compressor to use
* @return a stream the user can write uncompressed data to have it compresse... | 3.26 |
hadoop_FutureDataInputStreamBuilderImpl_getStatus_rdh | /**
* Get any status set in {@link #withFileStatus(FileStatus)}.
*
* @return a status value or null.
*/
protected FileStatus getStatus() {
return status;
} | 3.26 |
hadoop_FutureDataInputStreamBuilderImpl_builder_rdh | /**
* Get the builder.
* This must be used after the constructor has been invoked to create
* the actual builder: it allows for subclasses to do things after
* construction.
*
* @return FutureDataInputStreamBuilder.
*/
public FutureDataInputStreamBuilder builder() {
return getThisBuilder();
} | 3.26 |
hadoop_FutureDataInputStreamBuilderImpl_initFromFS_rdh | /**
* Initialize from a filesystem.
*/
private void initFromFS() { bufferSize = fileSystem.getConf().getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT);
} | 3.26 |
hadoop_FutureDataInputStreamBuilderImpl_bufferSize_rdh | /**
* Set the size of the buffer to be used.
*
* @param bufSize
* buffer size.
* @return FutureDataInputStreamBuilder.
*/
public FutureDataInputStreamBuilder
bufferSize(int bufSize) {
bufferSize = bufSize;
return getThisBuilder();
} | 3.26 |
hadoop_HdfsDataOutputStream_getCurrentBlockReplication_rdh | /**
* Get the actual number of replicas of the current block.
*
* This can be different from the designated replication factor of the file
* because the namenode does not maintain replication for the blocks which are
* currently being written to. Depending on the configuration, the client may
* continue to write ... | 3.26 |
hadoop_HdfsDataOutputStream_hsync_rdh | /**
* Sync buffered data to DataNodes (flush to disk devices).
*
* @param syncFlags
* Indicate the detailed semantic and actions of the hsync.
* @throws IOException
* @see FSDataOutputStream#hsync()
*/
public void hsync(EnumSet<SyncFlag> syncFlags) throws IOException {
OutputStream wrappedStream = getWrapp... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_validateToken_rdh | /**
* This method provides a single method for validating the JWT for use in
* request processing. It provides for the override of specific aspects of
* this implementation through submethods used within but also allows for the
* override of the entire token validation algorithm.
*
* @param jwtToken
* the toke... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_validateSignature_rdh | /**
* Verify the signature of the JWT token in this method. This method depends
* on the public key that was established during init based upon the
* provisioned public key. Override this method in subclasses in order to
* customize the signature verification behavior.
*
* @param jwtToken
* the token that cont... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_validateAudiences_rdh | /**
* Validate whether any of the accepted audience claims is present in the
* issued token claims list for audience. Override this method in subclasses
* in order to customize the audience validation behavior.
*
* @param jwtToken
* the JWT token where the allowed audiences will be found
* @return true if an e... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_constructLoginURL_rdh | /**
* Create the URL to be used for authentication of the user in the absence of
* a JWT token within the incoming request.
*
* @param request
* for getting the original request URL
* @return url to use as login url for redirect
*/
@VisibleForTesting
String constructLoginURL(HttpServletRequest request) {
S... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_setPublicKey_rdh | /**
* Primarily for testing, this provides a way to set the publicKey for
* signature verification without needing to get a PEM encoded value.
*
* @param pk
* publicKey for the token signtature verification
*/
public void setPublicKey(RSAPublicKey pk) {
publicKey = pk;
} | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_getJWTFromCookie_rdh | /**
* Encapsulate the acquisition of the JWT token from HTTP cookies within the
* request.
*
* @param req
* servlet request to get the JWT token from
* @return serialized JWT token
*/protected String getJWTFromCookie(HttpServletRequest req) {
String serializedJWT = null;
Cookie[] cookies = req.getCoo... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_init_rdh | /**
* Initializes the authentication handler instance.
* <p>
* This method is invoked by the {@link AuthenticationFilter#init} method.
* </p>
*
* @param config
* configuration properties to initialize the handler.
* @throws ServletException
* thrown if the handler could not be initialized.
*/
@Override
pu... | 3.26 |
hadoop_JWTRedirectAuthenticationHandler_validateExpiration_rdh | /**
* Validate that the expiration time of the JWT token has not been violated.
* If it has then throw an AuthenticationException. Override this method in
* subclasses in order to customize the expiration validation behavior.
*
* @param jwtToken
* the token that contains the expirati... | 3.26 |
hadoop_PathCapabilitiesSupport_validatePathCapabilityArgs_rdh | /**
* Validate the arguments to
* {@link PathCapabilities#hasPathCapability(Path, String)}.
*
* @param path
* path to query the capability of.
* @param capability
* non-null, non-empty string to query the path for support.
* @return the string to use in a switch statement.
* @throws IllegalArgumentExceptio... | 3.26 |
hadoop_DataJoinReducerBase_joinAndCollect_rdh | /**
* Perform the actual join recursively.
*
* @param tags
* a list of input tags
* @param values
* a list of value lists, each corresponding to one input source
* @param pos
* indicating the next value list to be joined
* @param partialList
* a list of values, each from one value list considered so f... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.