name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_AsyncAdmin_mergeSwitch_rdh | /**
* Turn the Merge switch on or off.
*
* @param enabled
* enabled or not
* @return Previous switch value wrapped by a {@link CompletableFuture}
*/
default CompletableFuture<Boolean> mergeSwitch(boolean enabled) {
return m4(enabled, false);} | 3.26 |
hbase_TakeSnapshotHandler_process_rdh | /**
* Execute the core common portions of taking a snapshot. The {@link #snapshotRegions(List)} call
* should get implemented for each snapshot flavor.
*/
@Override
@SuppressWarnings(value = "REC_CATCH_EXCEPTION", justification = "Intentional")
public void process() {String msg = (((((("Running " + snapshot.getType(... | 3.26 |
hbase_TakeSnapshotHandler_snapshotDisabledRegion_rdh | /**
* Take a snapshot of the specified disabled region
*/
protected void snapshotDisabledRegion(final RegionInfo regionInfo) throws IOException {
snapshotManifest.addRegion(CommonFSUtils.getTableDir(rootDir, snapshotTable), regionInfo);
f0.rethrowException();
status.setStatus((("Completed referencing HFiles for offli... | 3.26 |
hbase_WALKey_toStringMap_rdh | /**
* Produces a string map for this key. Useful for programmatic use and manipulation of the data
* stored in an WALKeyImpl, for example, printing as JSON.
*
* @return a Map containing data from this key
*/
default Map<String, Object> toStringMap() {
Map<String, Object> stringMap =
new HashMap<>();
st... | 3.26 |
hbase_WALKey_getNonceGroup_rdh | /**
* Returns The nonce group
*/
default long getNonceGroup() {
return HConstants.NO_NONCE;
} | 3.26 |
hbase_WALKey_getExtendedAttribute_rdh | /**
* Return a named String value injected into the WALKey during processing, such as by a
* coprocessor
*
* @param attributeKey
* The key of a key / value pair
*/
default byte[] getExtendedAttribute(String attributeKey) {
return null;
} | 3.26 |
hbase_WALKey_getNonce_rdh | /**
* Returns The nonce
*/
default long getNonce() {
return HConstants.NO_NONCE;
} | 3.26 |
hbase_WALKey_getExtendedAttributes_rdh | /**
* Returns a map of all extended attributes injected into this WAL key.
*/
default Map<String, byte[]> getExtendedAttributes() {
return new HashMap<>();
} | 3.26 |
hbase_ServerCall_done_rdh | /**
* Call is done. Execution happened and we returned results to client. It is now safe to cleanup.
*/
@SuppressWarnings(value = "IS2_INCONSISTENT_SYNC", justification = "Presume the lock on processing request held by caller is protection enough")
@Override
public void done() {
if (this.cellBlockStream != null... | 3.26 |
hbase_MapReduceBackupMergeJob_copyFile_rdh | /**
* Copy file in DFS from p to newPath
*
* @param fs
* file system
* @param p
* old path
* @param newPath
* new path
* @throws IOException
* exception
*/
protected void copyFile(FileSystem fs, Path p, Path newPath) throws IOException {
try (InputStream in = fs.open(p);OutputStream out = fs.create... | 3.26 |
hbase_MapReduceBackupMergeJob_copyMetaData_rdh | /**
* Copy meta data to of a backup session
*
* @param fs
* file system
* @param tmpBackupDir
* temp backup directory, where meta is locaed
* @param backupDirPath
* new path for backup
* @throws IOException
* exception
*/
protected void copyMetaData(FileSystem fs, Path tmpBackupDir, Path backupDirPat... | 3.26 |
hbase_MapReduceBackupMergeJob_convertToDest_rdh | /**
* Converts path before copying
*
* @param p
* path
* @param backupDirPath
* backup root
* @return converted path
*/
protected Path convertToDest(Path p, Path backupDirPath) {
String v32 = backupDirPath.getName();
Deque<String> stack = new ArrayDeque<String>();
String name = null;
while (true) {
name... | 3.26 |
hbase_DefaultVisibilityLabelServiceImpl_mutateLabelsRegion_rdh | /**
* Adds the mutations to labels region and set the results to the finalOpStatus. finalOpStatus
* might have some entries in it where the OpStatus is FAILURE. We will leave those and set in
* others in the order.
*
* @return whether we need a ZK update or not.
*/
private boolean mutateLabelsRegion(List<Mutation... | 3.26 |
hbase_DefaultVisibilityLabelServiceImpl_compareTagsOrdinals_rdh | /* @return true when all the visibility tags in Put matches with visibility tags in Delete. */
private static boolean compareTagsOrdinals(List<List<Integer>> putVisTags, List<List<Integer>> deleteVisTags) {
boolean matchFound = false;
if (deleteVisTags.size() == putVisTags.size()) {
for (List<Integer> deleteTagOrdina... | 3.26 |
hbase_DefaultVisibilityLabelServiceImpl_createModifiedVisExpression_rdh | /**
* - all the visibility tags associated with the current Cell
*
* @return - the modified visibility expression as byte[]
*/
private byte[] createModifiedVisExpression(final List<Tag> tags) throws IOException {
StringBuilder visibilityString = new StringBuilder();
for (Tag tag : tags) {
if (tag.getType() =... | 3.26 |
hbase_Cacheable_refCnt_rdh | /**
* Reference count of this Cacheable.
*/
default int refCnt() {
return 0;
} | 3.26 |
hbase_Cacheable_retain_rdh | /**
* ***************************** ReferenceCounted Interfaces **********************************
*/
/**
* Increase its reference count, and only when no reference we can free the object's memory.
*/
default Cacheable retain() {
return this;
} | 3.26 |
hbase_Cacheable_release_rdh | /**
* Decrease its reference count, and if no reference then free the memory of this object, its
* backend is usually a {@link org.apache.hadoop.hbase.nio.ByteBuff}, and we will put its NIO
* ByteBuffers back to {@link org.apache.hadoop.hbase.io.ByteBuffAllocator}
*/
default boolean release() {
return false;
} | 3.26 |
hbase_MapReduceBackupCopyJob_copy_rdh | /**
* Do backup copy based on different types.
*
* @param context
* The backup info
* @param conf
* The hadoop configuration
* @param copyType
* The backup copy type
* @param options
* Options for customized ExportSnapshot or DistCp
* @throws IOException
* exception
*/
@Override
public int copy(B... | 3.26 |
hbase_MapReduceBackupCopyJob_setSubTaskPercntgInWholeTask_rdh | /**
* Set the current copy task percentage within the whole task if multiple copies are needed. Must
* be called before calling
* {@link #copy(BackupInfo, BackupManager, Configuration, BackupType, String[])}
*
* @param subTaskPercntgInWholeTask
* The percentage of the copy subtask
*/
public void setSubTaskPerc... | 3.26 |
hbase_MapReduceBackupCopyJob_getSubTaskPercntgInWholeTask_rdh | /**
* Get the current copy task percentage within the whole task if multiple copies are needed.
*
* @return the current copy task percentage
*/
public float getSubTaskPercntgInWholeTask() {
return subTaskPercntgInWholeTask;
} | 3.26 |
hbase_Constraints_m0_rdh | /**
* Read the {@link Configuration} stored in the byte stream.
*
* @param bytes
* to read from
* @return A valid configuration
*/
private static Configuration m0(byte[] bytes) throws IOException {
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
Configuration conf = new Configuration(false);... | 3.26 |
hbase_Constraints_addConstraint_rdh | /**
* Write the raw constraint and configuration to the descriptor.
* <p/>
* This method takes care of creating a new configuration based on the passed in configuration and
* then updating that with enabled and priority of the constraint.
* <p/>
* When a constraint is added, it is automatically enabled.
*/
priva... | 3.26 |
hbase_Constraints_configure_rdh | /**
* Setup the configuration for a constraint as to whether it is enabled and its priority
*
* @param conf
* on which to base the new configuration
* @param enabled
* <tt>true</tt> if it should be run
* @param priority
* relative to other constraints
* @return a new configuration, storable in the {@link... | 3.26 |
hbase_Constraints_disableConstraint_rdh | /**
* Disable the given {@link Constraint}. Retains all the information (e.g. Configuration) for the
* {@link Constraint}, but it just doesn't load the {@link Constraint} on the table.
*
* @param builder
* {@link TableDescriptorBuilder} to modify
* @param clazz
* {@link Constraint} to disable.
* @throws IOE... | 3.26 |
hbase_Constraints_serializeConfiguration_rdh | /**
* Write the configuration to a String
*
* @param conf
* to write
* @return String representation of that configuration
*/
private static String serializeConfiguration(Configuration conf) throws IOException {
// write the configuration out to the data stream
ByteArrayOutputStream bos = new ByteArray... | 3.26 |
hbase_Constraints_setConfiguration_rdh | /**
* Update the configuration for the {@link Constraint}; does not change the order in which the
* constraint is run.
*
* @param builder
* {@link TableDescriptorBuilder} to update
* @param clazz
* {@link Constraint} to update
* @param configuration
* to update the {@link Constraint} with.
* @throws IOE... | 3.26 |
hbase_Constraints_m1_rdh | /**
* Read in the configuration from the String encoded configuration
*
* @param bytes
* to read from
* @return A valid configuration
* @throws IOException
* if the configuration could not be read
*/
private static Configuration m1(String bytes) throws IOException {
return m0(Bytes.toBytes(bytes));
... | 3.26 |
hbase_Constraints_remove_rdh | /**
* Remove the constraint (and associated information) for the table descriptor.
*
* @param builder
* {@link TableDescriptorBuilder} to modify
* @param clazz
* {@link Constraint} class to remove
*/
public static TableDescriptorBuilder remove(TableDescriptorBuilder builder, Class<? extends Constraint> clazz... | 3.26 |
hbase_Constraints_enable_rdh | /**
* Enable constraints on a table.
* <p/>
* Currently, if you attempt to add a constraint to the table, then Constraints will automatically
* be turned on.
*/
public static TableDescriptorBuilder enable(TableDescriptorBuilder builder) throws IOException {
if (!builder.hasCoprocessor(ConstraintProcessor.clas... | 3.26 |
hbase_Constraints_add_rdh | /**
* Add a {@link Constraint} to the table with the given configuration
* <p/>
* Each constraint, when added to the table, will have a specific priority, dictating the order in
* which the {@link Constraint} will be run. A {@link Constraint} added will run on the
* regionserver before those added to the {@link Ta... | 3.26 |
hbase_Constraints_enableConstraint_rdh | /**
* Enable the given {@link Constraint}. Retains all the information (e.g. Configuration) for the
* {@link Constraint}, but makes sure that it gets loaded on the table.
*
* @param builder
* {@link TableDescriptorBuilder} to modify
* @param clazz
* {@link Constraint} to enable
* @throws IOException
* If... | 3.26 |
hbase_Constraints_m2_rdh | /**
* Change the whether the constraint (if it is already present) is enabled or disabled.
*/
private static TableDescriptorBuilder m2(TableDescriptorBuilder builder, Class<? extends Constraint> clazz, boolean enabled) throws IOException {
// get the original constraint
Pair<String, String> entry = getKeyVa... | 3.26 |
hbase_Constraints_getConstraints_rdh | /**
* Get the constraints stored in the table descriptor
*
* @param desc
* To read from
* @param classloader
* To use when loading classes. If a special classloader is used on a region,
* for instance, then that should be the classloader used to load the
* constraints. This could also apply to unit-test... | 3.26 |
hbase_Constraints_serializeConstraintClass_rdh | /**
* Just write the class to a String representation of the class as a key for the
* {@link TableDescriptor}
*
* @param clazz
* Constraint class to convert to a {@link TableDescriptor} key
* @return key to store in the {@link TableDescriptor}
*/
private static String serializeConstraintClass(Class<? extends C... | 3.26 |
hbase_FlushPolicy_configureForRegion_rdh | /**
* Upon construction, this method will be called with the region to be governed. It will be called
* once and only once.
*/
protected void configureForRegion(HRegion region) {
this.region = region;
} | 3.26 |
hbase_CellArrayImmutableSegment_reinitializeCellSet_rdh | /* ------------------------------------------------------------------------ */
// Create CellSet based on CellChunkMap from current ConcurrentSkipListMap based CellSet
// (without compacting iterator)
// We do not consider cells bigger than chunks!
... | 3.26 |
hbase_CellArrayImmutableSegment_initializeCellSet_rdh | // /////////////////// PRIVATE METHODS /////////////////////
/* ------------------------------------------------------------------------ */
// Create CellSet based on CellArrayMap from compacting iterator
private void initializeCellSet(int numOfCells, MemStoreSegmentsIterator iterator, MemStoreCompactionStrategy.Action... | 3.26 |
hbase_HFile_isHFileFormat_rdh | /**
* Returns true if the specified file has a valid HFile Trailer.
*
* @param fs
* filesystem
* @param fileStatus
* the file to verify
* @return true if the file has a valid HFile Trailer, otherwise false
* @throws IOException
* if failed to read from the underlying stream
*/
public static boolean isHF... | 3.26 |
hbase_HFile_createReader_rdh | /**
*
* @param fs
* filesystem
* @param path
* Path to file to read
* @param cacheConf
* This must not be null.
* @param primaryReplicaReader
* true if this is a reader for primary replica
* @param conf
* Configuration
* @return an active Reader instance
* @throws IOException
* Will throw a Co... | 3.26 |
hbase_HFile_longToInt_rdh | // Utility methods.
/* @param l Long to convert to an int.
@return <code>l</code> cast as an int.
*/
static int longToInt(final long l) {
// Expecting the size() of a block not exceeding 4GB. Assuming the
// size() will wrap to negative integer if it exceeds 2GB (From tfile).
return ((int) (l & 0xffffffffL));
} | 3.26 |
hbase_HFile_getWriterFactoryNoCache_rdh | /**
* Returns the factory to be used to create {@link HFile} writers. Disables block cache access for
* all writers created through the returned factory.
*/
public static final WriterFactory getWriterFactoryNoCache(Configuration conf) {return HFile.getWriterFactory(conf, CacheConfig.DISABLED);
} | 3.26 |
hbase_HFile_getAndResetChecksumFailuresCount_rdh | /**
* Number of checksum verification failures. It also clears the counter.
*/
public static final long getAndResetChecksumFailuresCount() {
return CHECKSUM_FAILURES.sumThenReset();
} | 3.26 |
hbase_HFile_getWriterFactory_rdh | /**
* Returns the factory to be used to create {@link HFile} writers
*/
public static final WriterFactory
getWriterFactory(Configuration
conf, CacheConfig cacheConf) {
int version =
getFormatVersion(conf);
switch (version) {
case 2 :
throw new IllegalArgumentException((("This should never happen. " + "Di... | 3.26 |
hbase_HFile_m4_rdh | /**
* Returns all HFiles belonging to the given region directory. Could return an empty list.
*
* @param fs
* The file system reference.
* @param regionDir
* The region directory to scan.
* @return The list of files found.
* @throws IOException
* When scanning the files fails.
*/
public static List<Path... | 3.26 |
hbase_HFile_getChecksumFailuresCount_rdh | /**
* Number of checksum verification failures. It also clears the counter.
*/
public static final long getChecksumFailuresCount() {
return CHECKSUM_FAILURES.sum();
} | 3.26 |
hbase_DisabledTableSnapshotHandler_snapshotRegions_rdh | // TODO consider parallelizing these operations since they are independent. Right now its just
// easier to keep them serial though
@Override
public void snapshotRegions(List<Pair<RegionInfo, ServerName>>
regionsAndLocations) throws IOException, KeeperException {
try {
// 1. get ... | 3.26 |
hbase_MasterRegistry_parseMasterAddrs_rdh | /**
* Parses the list of master addresses from the provided configuration. Supported format is comma
* separated host[:port] values. If no port number if specified, default master port is assumed.
*
* @param conf
* Configuration to parse from.
*/
public static Set<ServerName> parseMasterAddrs(Configuration conf... | 3.26 |
hbase_MasterRegistry_getDefaultMasterPort_rdh | /**
* Supplies the default master port we should use given the provided configuration.
*
* @param conf
* Configuration to parse from.
*/
private static int getDefaultMasterPort(Configuration conf) {
final int port = conf.getInt(HConstants.MASTER_PORT, HConstants.DEFAULT_MASTER_PORT);
if (port == 0) {
... | 3.26 |
hbase_ZNodePaths_isClientReadable_rdh | /**
* Returns whether the path is supposed to be readable by the client and DOES NOT contain
* sensitive information (world readable).
*/
public boolean isClientReadable(String
path) {
// Developer notice: These znodes are world readable. DO NOT add more znodes here UNLESS
// all clients need to access this ... | 3.26 |
hbase_ZNodePaths_getMetaReplicaIdFromPath_rdh | /**
* Parses the meta replicaId from the passed path.
*
* @param path
* the name of the full path which includes baseZNode.
*/
public int getMetaReplicaIdFromPath(String path) {// Extract the znode from path. The prefix is of the following format.
// baseZNode + PATH_SEPARATOR.
int prefixLen = baseZNode.... | 3.26 |
hbase_ZNodePaths_isMetaZNodePath_rdh | /**
* Returns True is the fully qualified path is for meta location
*/
public boolean isMetaZNodePath(String path) {
int prefixLen = baseZNode.length() + 1;return (path.length() > prefixLen) && isMetaZNodePrefix(path.substring(prefixLen));
} | 3.26 |
hbase_ZNodePaths_getMetaReplicaIdFromZNode_rdh | /**
* Parse the meta replicaId from the passed znode
*
* @param znode
* the name of the znode, does not include baseZNode
*/public int getMetaReplicaIdFromZNode(String znode) {
return znode.equals(metaZNodePrefix) ? RegionInfo.DEFAULT_REPLICA_ID : Integer.parseInt(znode.substrin... | 3.26 |
hbase_ZNodePaths_getZNodeForReplica_rdh | /**
* Returns the znode string corresponding to a replicaId
*/
public String getZNodeForReplica(int replicaId) {
if (RegionReplicaUtil.isDefaultReplica(replicaId)) {
return joinZNode(baseZNode, metaZNodePrefix);
} else {
return joinZNode(baseZNode, (metaZNodePrefix + "-") + replicaId);
}
} | 3.26 |
hbase_ZNodePaths_joinZNode_rdh | /**
* Join the prefix znode name with the suffix znode name to generate a proper full znode name.
* <p>
* Assumes prefix does not end with slash and suffix does not begin with it.
*
* @param prefix
* beginning of znode name
* @param suffix
* ending of znode name
* @return result of properly joining prefix ... | 3.26 |
hbase_ZNodePaths_isMetaZNodePrefix_rdh | /**
* Returns True if meta znode.
*/
public boolean isMetaZNodePrefix(String znode) {
return
(znode != null) && znode.startsWith(this.metaZNodePrefix);
} | 3.26 |
hbase_HttpServer_addJerseyResourcePackage_rdh | /**
* Add a Jersey resource package.
*
* @param packageName
* The Java package name containing the Jersey resource.
* @param pathSpec
* The path spec for the servlet
*/
public void addJerseyResourcePackage(final String packageName, final String pathSpec) {
LOG.info((("addJerseyResourcePackage: packageN... | 3.26 |
hbase_HttpServer_stop_rdh | /**
* stop the server
*/
public void stop()
throws Exception {
MultiException exception
= null;
for (ListenerInfo li : listeners) {
if (!li.f0) {
continue;
}
try {
li.listener.close();
} catch (Exception e) {LOG.error("Error while stopping listener for webapp" + webAppContext.getDisplayName(), e);
exception = m6(exc... | 3.26 |
hbase_HttpServer_hasAdministratorAccess_rdh | /**
* Does the user sending the HttpServletRequest has the administrator ACLs? If it isn't the case,
* response will be modified to send an error to the user.
*
* @param servletContext
* the {@link ServletContext} to use
* @param request
* the {@link HttpServletRequest} to check
* @param response
* used ... | 3.26 |
hbase_HttpServer_getParameter_rdh | /**
* Unquote the name and quote the value.
*/
@Override
public String
getParameter(String name) {
return HtmlQuoting.quoteHtmlChars(rawRequest.getParameter(HtmlQuoting.unquoteHtmlChars(name)));} | 3.26 |
hbase_HttpServer_toString_rdh | /**
* Return the host and port of the HttpServer, if live
*
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
if (listeners.isEmpty()) {
return "Inactive HttpServer";
} else {
StringBuilder
sb = new StringBuilder("HttpServer (").append(isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DE... | 3.26 |
hbase_HttpServer_getParameterNames_rdh | /**
* Return the set of parameter names, quoting each name.
*/@Override
public Enumeration<String> getParameterNames() {
return new Enumeration<String>() {private Enumeration<String> rawIterator = rawRequest.getParameterNames();
@Override
public boolean hasMoreElements() {
return rawIterator.hasMoreElements();
}
@O... | 3.26 |
hbase_HttpServer_start_rdh | /**
* Start the server. Does not wait for the server to start.
*/
public void start() throws IOException {try {
try {
openListeners();
webServer.start();
} catch (IOException ex) {
LOG.info("HttpServer.start() threw a non Bind IOException", ex);
throw ex;
} catch (MultiException ex) {
LOG.info("H... | 3.26 |
hbase_HttpServer_getAttribute_rdh | /**
* Get the value in the webapp context.
*
* @param name
* The name of the attribute
* @return The value of the attribute
*/
public Object getAttribute(String name)
{
return webAppContext.getAttribute(name);
} | 3.26 |
hbase_HttpServer_setBindAddress_rdh | /**
*
* @see #addEndpoint(URI)
* @deprecated Since 0.99.0. Use {@link #addEndpoint(URI)} instead.
*/
@Deprecated
public Builder setBindAddress(String bindAddress) {
this.bindAddress = bindAddress;
return this;
} | 3.26 |
hbase_HttpServer_addPrivilegedServlet_rdh | /**
* Adds a servlet in the server that only administrators can access. This method differs from
* {@link #addUnprivilegedServlet(String, ServletHolder)} in that only those authenticated user
* who are identified as administrators can interact with the servlet added by this method.
*/
public void addPrivilegedServl... | 3.26 |
hbase_HttpServer_isInstrumentationAccessAllowed_rdh | /**
* Checks the user has privileges to access to instrumentation servlets.
* <p>
* If <code>hadoop.security.instrumentation.requires.admin</code> is set to FALSE (default value)
* it always returns TRUE.
* </p>
* <p>
* If <code>hadoop.security.instrumentation.requires.admin</code> is set to TRUE it will check
... | 3.26 |
hbase_HttpServer_buildGzipHandler_rdh | /**
* Construct and configure an instance of {@link GzipHandler}. With complex
* multi-{@link WebAppContext} configurations, it's easiest to apply this handler directly to the
* instance of {@link Server} near the end of its configuration, something like
*
* <pre>
* Server server = new Server();
* // ...
* serv... | 3.26 |
hbase_HttpServer_needsClientAuth_rdh | /**
* Specify whether the server should authorize the client in SSL connections.
*/
public Builder needsClientAuth(boolean value) {
this.needsClientAuth = value;
return this;
} | 3.26 |
hbase_HttpServer_setName_rdh | /**
*
* @see #setAppDir(String)
* @deprecated Since 0.99.0. Use {@link #setAppDir(String)} instead.
*/
@Deprecated
public Builder setName(String name) {
this.name = name;return this;
} | 3.26 |
hbase_HttpServer_getServerName_rdh | /**
* Quote the server name so that users specifying the HOST HTTP header can't inject attacks.
*/
@Override
public String getServerName() {
return HtmlQuoting.quoteHtmlChars(rawRequest.getServerName());
} | 3.26 |
hbase_HttpServer_setThreads_rdh | /**
* Set the min, max number of worker threads (simultaneous connections).
*/
public void setThreads(int min, int max) {
QueuedThreadPool pool
= ((QueuedThreadPool) (webServer.getThreadPool()));
pool.setMinThreads(min);
pool.setMaxThreads(max);
} | 3.26 |
hbase_HttpServer_addDefaultApps_rdh | /**
* Add default apps.
*
* @param appDir
* The application directory
*/
protected void addDefaultApps(ContextHandlerCollection parent, final String appDir, Configuration conf) {
// set up the context for "/logs/" if "hadoop.log.dir" property is defined.
String logDir = this.logDir;
if (logDir == nul... | 3.26 |
hbase_HttpServer_hostName_rdh | /**
* Set the hostname of the http server. The host name is used to resolve the _HOST field in
* Kerberos principals. The hostname of the first listener will be used if the name is
* unspecified.
*/
public Builder hostName(String hostName) {
this.hostName = hostName;
return this;
} | 3.26 |
hbase_HttpServer_isAlive_rdh | /**
* Test for the availability of the web server
*
* @return true if the web server is started, false otherwise
*/
public boolean isAlive() {
return (webServer != null) && webServer.isStarted();
} | 3.26 |
hbase_HttpServer_setPort_rdh | /**
*
* @see #addEndpoint(URI)
* @deprecated Since 0.99.0. Use {@link #addEndpoint(URI)} instead.
*/
@Deprecated
public Builder setPort(int port) {
this.port = port;
return this;
} | 3.26 |
hbase_HttpServer_openListeners_rdh | /**
* Open the main listener for the server
*
* @throws Exception
* if the listener cannot be opened or the appropriate port is already in use
*/void
openListeners() throws Exception {
for (ListenerInfo li : listeners) {
ServerConnector listener
= li.listener;
if ((!li.f0) || ((li.listener.getLocalPort() != (-1)... | 3.26 |
hbase_HttpServer_inferMimeType_rdh | /**
* Infer the mime type for the response based on the extension of the request URI. Returns null
* if unknown.
*/private String inferMimeType(ServletRequest request) {
String path = ((HttpServletRequest) (request)).getRequestURI();
ServletContext context = config.getServletContext();
return context.getMimeType(p... | 3.26 |
hbase_HttpServer_getWebAppsPath_rdh | /**
* Get the pathname to the webapps files.
*
* @param appName
* eg "secondary" or "datanode"
* @return the pathname as a URL
* @throws FileNotFoundException
* if 'webapps' directory cannot be found on CLASSPATH.
*/protected String getWebAppsPath(String
webapps, String appName) throws FileNotFoundException... | 3.26 |
hbase_HttpServer_isMissing_rdh | /**
* Returns true if the argument is non-null and not whitespace
*/
private boolean isMissing(String value) {
if (null == value) {
return true;
}
return value.trim().isEmpty();
} | 3.26 |
hbase_HttpServer_addInternalServlet_rdh | /**
* Add an internal servlet in the server, specifying whether or not to protect with Kerberos
* authentication. Note: This method is to be used for adding servlets that facilitate internal
* communication and not for user facing functionality. For servlets added using this method,
* filters (except internal Kerbe... | 3.26 |
hbase_HttpServer_addServletWithAuth_rdh | /**
* Internal method to add a servlet to the HTTP server. Developers should not call this method
* directly, but invoke it via {@link #addUnprivilegedServlet(String, ServletHolder)} or
* {@link #addPrivilegedServlet(String, ServletHolder)}.
*/
void
addServletWithAuth(String pathSpec, ServletHolder holder, boolean ... | 3.26 |
hbase_HttpServer_m4_rdh | /**
* Add an internal servlet in the server, specifying whether or not to protect with Kerberos
* authentication. Note: This method is to be used for adding servlets that facilitate internal
* communication and not for user facing functionality. For servlets added using this method,
* filters (e... | 3.26 |
hbase_HttpServer_addUnprivilegedServlet_rdh | /**
* Adds a servlet in the server that any user can access. This method differs from
* {@link #addPrivilegedServlet(String, ServletHolder)} in that any authenticated user can
* interact with the servlet added by this method.
*
* @param pathSpec
* The path spec for the servlet
* @param holder
* The servlet ... | 3.26 |
hbase_HttpServer_defineFilter_rdh | /**
* Define a filter for a context and set up default url mappings.
*/
public static void defineFilter(ServletContextHandler handler, String name, String classname, Map<String, String> parameters, String[] urls) {
FilterHolder holder = new FilterHolder();holder.setName(name);
holder.setClassName(classname);
... | 3.26 |
hbase_HttpServer_getOrEmptyString_rdh | /**
* Extracts the value for the given key from the configuration of returns a string of zero length.
*/
private String getOrEmptyString(Configuration conf, String key) {
if (null == key) {
return EMPTY_STRING;
}final String value = conf.get(key.trim());
return null == value ? EMPTY_STRING
: value;
} | 3.26 |
hbase_HttpServer_m5_rdh | /**
* Add the path spec to the filter path mapping.
*
* @param pathSpec
* The path spec
* @param webAppCtx
* The WebApplicationContext to add to
*/protected void
m5(String pathSpec, WebAppContext webAppCtx)
{
for (String name : filterNames) {
FilterMapping fmap = new FilterMapping();
fmap... | 3.26 |
hbase_HttpServer_setAttribute_rdh | /**
* Set a value in the webapp context. These values are available to the jsp pages as
* "application.getAttribute(name)".
*
* @param name
* The name of the attribute
* @param value
* The value of the attribute
*/
public void setAttribute(String name, Object value) {
webAppContext.setAttribute(name, ... | 3.26 |
hbase_HttpServer_addDefaultServlets_rdh | /**
* Add default servlets.
*/
protected void addDefaultServlets(ContextHandlerCollection contexts, Configuration conf) throws IOException {
// set up default servlets
addPrivilegedServlet("stacks", "/stacks", HttpServer.StackServlet.class);
addPrivilegedServlet("logLevel", "/logLevel", Servlet.class);... | 3.26 |
hbase_HttpServer_getPort_rdh | /**
* Get the port that the server is on
*
* @return the port
* @deprecated Since 0.99.0
*/
@Deprecated
public int getPort()
{return ((ServerConnector) (webServer.getConnectors()[0])).getLocalPort();
} | 3.26 |
hbase_HttpServer_getFilterInitializers_rdh | /**
* Get an array of FilterConfiguration specified in the conf
*/
private static FilterInitializer[] getFilterInitializers(Configuration conf) {
if (conf == null) {
return null;
}
Class<?>[] classes = conf.getClasses(FILTER_INITIALIZERS_PROPERTY);
if (classes == null) {
return null;
... | 3.26 |
hbase_OnlineLogRecord_getScan_rdh | /**
* If {@value org.apache.hadoop.hbase.HConstants#SLOW_LOG_SCAN_PAYLOAD_ENABLED} is enabled then
* this value may be present and should represent the Scan that produced the given
* {@link OnlineLogRecord}
*/
public Optional<Scan> getScan() {
return scan;
} | 3.26 |
hbase_OnlineLogRecord_getBlockBytesScanned_rdh | /**
* Return the amount of block bytes scanned to retrieve the response cells.
*/
public long getBlockBytesScanned() {
return blockBytesScanned;
} | 3.26 |
hbase_OnlineLogRecord_setBlockBytesScanned_rdh | /**
* Sets the amount of block bytes scanned to retrieve the response cells.
*/
public OnlineLogRecordBuilder setBlockBytesScanned(long blockBytesScanned) { this.blockBytesScanned = blockBytesScanned;
return this;
} | 3.26 |
hbase_DoubleArrayCost_applyCostsChange_rdh | /**
* We do not want to introduce a getCosts method to let upper layer get the cost array directly,
* so here we introduce this method to take a {@link Consumer} as parameter, where we will pass
* the actual cost array in, so you can change the element of the cost array in the
* {@link Consumer} implementation.
* ... | 3.26 |
hbase_DoubleArrayCost_getMaxSkew_rdh | /**
* Return the max deviation of distribution Compute max as if all region servers had 0 and one had
* the sum of all costs. This must be a zero sum cost for this to make sense.
*/
public static double getMaxSkew(double total, double numServers) {
if (numServers == 0) {
return 0;
}
double mean ... | 3.26 |
hbase_DoubleArrayCost_getMinSkew_rdh | /**
* Return the min skew of distribution
*
* @param total
* is total number of regions
*/
public static double getMinSkew(double total, double numServers) {
if (numServers ==
0) {
return 0;
}
double mean = total / numServers;
// It's possible that ... | 3.26 |
hbase_ClusterConnectionFactory_createAsyncClusterConnection_rdh | /**
* Create a new {@link AsyncClusterConnection} instance to be used at server side where we have a
* {@link ConnectionRegistryEndpoint}.
*/
public static AsyncClusterConnection createAsyncClusterConnection(ConnectionRegistryEndpoint endpoint, Configuration conf, SocketAddress localAddress, User user) throws IOExce... | 3.26 |
hbase_RestCsrfPreventionFilter_handleHttpInteraction_rdh | /**
* Handles an {@link HttpInteraction} by applying the filtering logic.
*
* @param httpInteraction
* caller's HTTP interaction
* @throws IOException
* if there is an I/O error
* @throws ServletException
* if the implementation relies on the servlet API and a servlet API call
* has failed
*/
public v... | 3.26 |
hbase_RestCsrfPreventionFilter_getFilterParams_rdh | /**
* Constructs a mapping of configuration properties to be used for filter initialization. The
* mapping includes all properties that start with the specified configuration prefix. Property
* names in the mapping are trimmed to remove the configuration prefix.
*
* @param conf
* configuration to read
* @param... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.