Java Code Examples for org.apache.hadoop.classification.InterfaceStability#Unstable
The following examples show how to use
org.apache.hadoop.classification.InterfaceStability#Unstable .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Configuration.java From big-c with Apache License 2.0 | 6 votes |
/** * Gets information about why a property was set. Typically this is the * path to the resource objects (file, URL, etc.) the property came from, but * it can also indicate that it was set programatically, or because of the * command line. * * @param name - The property name to get the source of. * @return null - If the property or its source wasn't found. Otherwise, * returns a list of the sources of the resource. The older sources are * the first ones in the list. So for example if a configuration is set from * the command line, and then written out to a file that is read back in the * first entry would indicate that it was set from the command line, while * the second one would indicate the file that the new configuration was read * in from. */ @InterfaceStability.Unstable public synchronized String[] getPropertySources(String name) { if (properties == null) { // If properties is null, it means a resource was newly added // but the props were cleared so as to load it upon future // requests. So lets force a load by asking a properties list. getProps(); } // Return a null right away if our properties still // haven't loaded or the resource mapping isn't defined if (properties == null || updatingResource == null) { return null; } else { String[] source = updatingResource.get(name); if(source == null) { return null; } else { return Arrays.copyOf(source, source.length); } } }
Example 2
Source File: Configuration.java From flink with Apache License 2.0 | 6 votes |
/** * Gets information about why a property was set. Typically this is the * path to the resource objects (file, URL, etc.) the property came from, but * it can also indicate that it was set programatically, or because of the * command line. * * @param name - The property name to get the source of. * @return null - If the property or its source wasn't found. Otherwise, * returns a list of the sources of the resource. The older sources are * the first ones in the list. So for example if a configuration is set from * the command line, and then written out to a file that is read back in the * first entry would indicate that it was set from the command line, while * the second one would indicate the file that the new configuration was read * in from. */ @InterfaceStability.Unstable public synchronized String[] getPropertySources(String name) { if (properties == null) { // If properties is null, it means a resource was newly added // but the props were cleared so as to load it upon future // requests. So lets force a load by asking a properties list. getProps(); } // Return a null right away if our properties still // haven't loaded or the resource mapping isn't defined if (properties == null || updatingResource == null) { return null; } else { String[] source = updatingResource.get(name); if(source == null) { return null; } else { return Arrays.copyOf(source, source.length); } } }
Example 3
Source File: Configuration.java From flink with Apache License 2.0 | 6 votes |
/** * Gets information about why a property was set. Typically this is the * path to the resource objects (file, URL, etc.) the property came from, but * it can also indicate that it was set programmatically, or because of the * command line. * * @param name - The property name to get the source of. * @return null - If the property or its source wasn't found. Otherwise, * returns a list of the sources of the resource. The older sources are * the first ones in the list. So for example if a configuration is set from * the command line, and then written out to a file that is read back in the * first entry would indicate that it was set from the command line, while * the second one would indicate the file that the new configuration was read * in from. */ @InterfaceStability.Unstable public synchronized String[] getPropertySources(String name) { if (properties == null) { // If properties is null, it means a resource was newly added // but the props were cleared so as to load it upon future // requests. So lets force a load by asking a properties list. getProps(); } // Return a null right away if our properties still // haven't loaded or the resource mapping isn't defined if (properties == null || updatingResource == null) { return null; } else { String[] source = updatingResource.get(name); if(source == null) { return null; } else { return Arrays.copyOf(source, source.length); } } }
Example 4
Source File: UserGroupInformation.java From big-c with Apache License 2.0 | 5 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable @VisibleForTesting public synchronized static void setLoginUser(UserGroupInformation ugi) { // if this is to become stable, should probably logout the currently // logged in ugi if it's different loginUser = ugi; }
Example 5
Source File: COSInputStream.java From stocator with Apache License 2.0 | 5 votes |
/** * Forcibly reset the stream, by aborting the connection. The next * {@code read()} operation will trigger the opening of a new HTTPS * connection. * * This is potentially very inefficient, and should only be invoked * in extreme circumstances. It logs at info for this reason. * @return true if the connection was actually reset * @throws IOException if invoked on a closed stream */ @InterfaceStability.Unstable public synchronized boolean resetConnection() throws IOException { checkNotClosed(); boolean connectionOpen = wrappedStream != null; if (connectionOpen) { LOG.info("Forced reset of connection to {}", uri); closeStream("reset()", contentRangeFinish, true); } return connectionOpen; }
Example 6
Source File: UserGroupInformation.java From hadoop with Apache License 2.0 | 5 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable @VisibleForTesting public synchronized static void setLoginUser(UserGroupInformation ugi) { // if this is to become stable, should probably logout the currently // logged in ugi if it's different loginUser = ugi; }
Example 7
Source File: SaslRpcServer.java From big-c with Apache License 2.0 | 5 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public SaslRpcServer(AuthMethod authMethod) throws IOException { this.authMethod = authMethod; mechanism = authMethod.getMechanismName(); switch (authMethod) { case SIMPLE: { return; // no sasl for simple } case TOKEN: { protocol = ""; serverId = SaslRpcServer.SASL_DEFAULT_REALM; break; } case KERBEROS: { String fullName = UserGroupInformation.getCurrentUser().getUserName(); if (LOG.isDebugEnabled()) LOG.debug("Kerberos principal name is " + fullName); // don't use KerberosName because we don't want auth_to_local String[] parts = fullName.split("[/@]", 3); protocol = parts[0]; // should verify service host is present here rather than in create() // but lazy tests are using a UGI that isn't a SPN... serverId = (parts.length < 2) ? "" : parts[1]; break; } default: // we should never be able to get here throw new AccessControlException( "Server does not support SASL " + authMethod); } }
Example 8
Source File: Client.java From big-c with Apache License 2.0 | 5 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable Set<ConnectionId> getConnectionIds() { synchronized (connections) { return connections.keySet(); } }
Example 9
Source File: ProtobufRpcEngine.java From hadoop with Apache License 2.0 | 5 votes |
@VisibleForTesting @InterfaceAudience.Private @InterfaceStability.Unstable static Client getClient(Configuration conf) { return CLIENTS.getClient(conf, SocketFactory.getDefault(), RpcResponseWrapper.class); }
Example 10
Source File: SwiftInputStream.java From stocator with Apache License 2.0 | 4 votes |
/** * How many bytes has left in the request * * @return how many bytes are left to read in the current GET */ @InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long remainingInCurrentRequest() { return contentRangeFinish - pos; }
Example 11
Source File: COSInputStream.java From stocator with Apache License 2.0 | 4 votes |
/** * Bytes left in stream. * @return how many bytes are left to read */ @InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long remainingInFile() { return contentLength - pos; }
Example 12
Source File: SaslRpcServer.java From big-c with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public SaslServer create(final Connection connection, final Map<String,?> saslProperties, SecretManager<TokenIdentifier> secretManager ) throws IOException, InterruptedException { UserGroupInformation ugi = null; final CallbackHandler callback; switch (authMethod) { case TOKEN: { callback = new SaslDigestCallbackHandler(secretManager, connection); break; } case KERBEROS: { ugi = UserGroupInformation.getCurrentUser(); if (serverId.isEmpty()) { throw new AccessControlException( "Kerberos principal name does NOT have the expected " + "hostname part: " + ugi.getUserName()); } callback = new SaslGssCallbackHandler(); break; } default: // we should never be able to get here throw new AccessControlException( "Server does not support SASL " + authMethod); } final SaslServer saslServer; if (ugi != null) { saslServer = ugi.doAs( new PrivilegedExceptionAction<SaslServer>() { @Override public SaslServer run() throws SaslException { return saslFactory.createSaslServer(mechanism, protocol, serverId, saslProperties, callback); } }); } else { saslServer = saslFactory.createSaslServer(mechanism, protocol, serverId, saslProperties, callback); } if (saslServer == null) { throw new AccessControlException( "Unable to find SASL server implementation for " + mechanism); } if (LOG.isDebugEnabled()) { LOG.debug("Created SASL server with mechanism = " + mechanism); } return saslServer; }
Example 13
Source File: COSInputStream.java From stocator with Apache License 2.0 | 4 votes |
/** * Bytes left in the current request. * Only valid if there is an active request. * @return how many bytes are left to read in the current GET */ @InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long remainingInCurrentRequest() { return contentRangeFinish - pos; }
Example 14
Source File: COSInputStream.java From stocator with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long getContentRangeFinish() { return contentRangeFinish; }
Example 15
Source File: COSInputStream.java From stocator with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long getContentRangeStart() { return contentRangeStart; }
Example 16
Source File: SaslRpcServer.java From hadoop with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public SaslServer create(final Connection connection, final Map<String,?> saslProperties, SecretManager<TokenIdentifier> secretManager ) throws IOException, InterruptedException { UserGroupInformation ugi = null; final CallbackHandler callback; switch (authMethod) { case TOKEN: { callback = new SaslDigestCallbackHandler(secretManager, connection); break; } case KERBEROS: { ugi = UserGroupInformation.getCurrentUser(); if (serverId.isEmpty()) { throw new AccessControlException( "Kerberos principal name does NOT have the expected " + "hostname part: " + ugi.getUserName()); } callback = new SaslGssCallbackHandler(); break; } default: // we should never be able to get here throw new AccessControlException( "Server does not support SASL " + authMethod); } final SaslServer saslServer; if (ugi != null) { saslServer = ugi.doAs( new PrivilegedExceptionAction<SaslServer>() { @Override public SaslServer run() throws SaslException { return saslFactory.createSaslServer(mechanism, protocol, serverId, saslProperties, callback); } }); } else { saslServer = saslFactory.createSaslServer(mechanism, protocol, serverId, saslProperties, callback); } if (saslServer == null) { throw new AccessControlException( "Unable to find SASL server implementation for " + mechanism); } if (LOG.isDebugEnabled()) { LOG.debug("Created SASL server with mechanism = " + mechanism); } return saslServer; }
Example 17
Source File: SwiftInputStream.java From stocator with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long getContentRangeStart() { return contentRangeStart; }
Example 18
Source File: SwiftInputStream.java From stocator with Apache License 2.0 | 4 votes |
@InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long getContentRangeFinish() { return contentRangeFinish; }
Example 19
Source File: DistributedFileSystem.java From hadoop with Apache License 2.0 | 3 votes |
/** * Used to query storage location information for a list of blocks. This list * of blocks is normally constructed via a series of calls to * {@link DistributedFileSystem#getFileBlockLocations(Path, long, long)} to * get the blocks for ranges of a file. * * The returned array of {@link BlockStorageLocation} augments * {@link BlockLocation} with a {@link VolumeId} per block replica. The * VolumeId specifies the volume on the datanode on which the replica resides. * The VolumeId associated with a replica may be null because volume * information can be unavailable if the corresponding datanode is down or * if the requested block is not found. * * This API is unstable, and datanode-side support is disabled by default. It * can be enabled by setting "dfs.datanode.hdfs-blocks-metadata.enabled" to * true. * * @param blocks * List of target BlockLocations to query volume location information * @return volumeBlockLocations Augmented array of * {@link BlockStorageLocation}s containing additional volume location * information for each replica of each block. */ @InterfaceStability.Unstable public BlockStorageLocation[] getFileBlockStorageLocations( List<BlockLocation> blocks) throws IOException, UnsupportedOperationException, InvalidBlockTokenException { return dfs.getBlockStorageLocations(blocks); }
Example 20
Source File: SwiftInputStream.java From stocator with Apache License 2.0 | 2 votes |
/** * Bytes left in stream. * * @return how many bytes are left to read * @throws IOException if error */ @InterfaceAudience.Private @InterfaceStability.Unstable public synchronized long remainingInFile() throws IOException { return objectCache.get(objName).getContentLength() - pos; }