Java Code Examples for org.apache.hadoop.classification.InterfaceAudience#Private

The following examples show how to use org.apache.hadoop.classification.InterfaceAudience#Private . 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: TokenCache.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/**
 * load job token from a file
 * @deprecated Use {@link Credentials#readTokenStorageFile} instead,
 * this method is included for compatibility against Hadoop-1.
 * @param conf
 * @throws IOException
 */
@InterfaceAudience.Private
@Deprecated
public static Credentials loadTokens(String jobTokenFile, JobConf conf)
throws IOException {
  Path localJobTokenFile = new Path ("file:///" + jobTokenFile);

  Credentials ts = Credentials.readTokenStorageFile(localJobTokenFile, conf);

  if(LOG.isDebugEnabled()) {
    LOG.debug("Task: Loaded jobTokenFile from: "+
        localJobTokenFile.toUri().getPath() 
        +"; num of sec keys  = " + ts.numberOfSecretKeys() +
        " Number of tokens " +  ts.numberOfTokens());
  }
  return ts;
}
 
Example 2
Source File: HttpServer.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@InterfaceAudience.Private
public static Connector createDefaultChannelConnector() {
  SelectChannelConnector ret = new SelectChannelConnectorWithSafeStartup();
  ret.setLowResourceMaxIdleTime(10000);
  ret.setAcceptQueueSize(128);
  ret.setResolveNames(false);
  ret.setUseDirectBuffers(false);
  if(Shell.WINDOWS) {
    // result of setting the SO_REUSEADDR flag is different on Windows
    // http://msdn.microsoft.com/en-us/library/ms740621(v=vs.85).aspx
    // without this 2 NN's can start on the same machine and listen on 
    // the same port with indeterminate routing of incoming requests to them
    ret.setReuseAddress(false);
  }
  ret.setHeaderBufferSize(1024*64);
  return ret;
}
 
Example 3
Source File: CompositeContext.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void unregisterUpdater(Updater updater) {
  for (MetricsContext ctxt : subctxt) {
    ctxt.unregisterUpdater(updater);
  }
}
 
Example 4
Source File: DataNode.java    From big-c with Apache License 2.0 5 votes vote down vote up
/** Instantiate & Start a single datanode daemon and wait for it to finish.
 *  If this thread is specifically interrupted, it will stop waiting.
 */
@VisibleForTesting
@InterfaceAudience.Private
public static DataNode createDataNode(String args[], Configuration conf,
    SecureResources resources) throws IOException {
  DataNode dn = instantiateDataNode(args, conf, resources);
  if (dn != null) {
    dn.runDatanodeDaemon();
  }
  return dn;
}
 
Example 5
Source File: CompositeContext.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public void startMonitoring() throws IOException {
  for (MetricsContext ctxt : subctxt) {
    try {
      ctxt.startMonitoring();
    } catch (IOException e) {
      LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e);
    }
  }
}
 
Example 6
Source File: GangliaContext.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
@InterfaceAudience.Private
public void emitRecord(String contextName, String recordName,
  OutputRecord outRec) 
throws IOException {
  // Setup so that the records have the proper leader names so they are
  // unambiguous at the ganglia level, and this prevents a lot of rework
  StringBuilder sb = new StringBuilder();
  sb.append(contextName);
  sb.append('.');

  if (contextName.equals("jvm") && outRec.getTag("processName") != null) {
    sb.append(outRec.getTag("processName"));
    sb.append('.');
  }

  sb.append(recordName);
  sb.append('.');
  int sbBaseLen = sb.length();

  // emit each metric in turn
  for (String metricName : outRec.getMetricNames()) {
    Object metric = outRec.getMetric(metricName);
    String type = typeTable.get(metric.getClass());
    if (type != null) {
      sb.append(metricName);
      emitMetric(sb.toString(), type, metric.toString());
      sb.setLength(sbBaseLen);
    } else {
      LOG.warn("Unknown metrics type: " + metric.getClass());
    }
  }
}
 
Example 7
Source File: UserGroupInformation.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@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 8
Source File: ServerRMProxy.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
protected void checkAllowedProtocols(Class<?> protocol) {
  Preconditions.checkArgument(
      protocol.isAssignableFrom(ResourceTracker.class),
      "ResourceManager does not support this protocol");
}
 
Example 9
Source File: AvroSpecificSerialization.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@Override
public DatumReader getReader(Class<SpecificRecord> clazz) {
  try {
    return new SpecificDatumReader(clazz.newInstance().getSchema());
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
Example 10
Source File: MiniYARNCluster.java    From big-c with Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
@VisibleForTesting
public synchronized void stopResourceManager(int index) {
  if (resourceManagers[index] != null) {
    resourceManagers[index].stop();
    resourceManagers[index] = null;
  }
}
 
Example 11
Source File: COSInputStream.java    From stocator with Apache License 2.0 4 votes vote down vote up
@InterfaceAudience.Private
@InterfaceStability.Unstable
public synchronized long getContentRangeFinish() {
  return contentRangeFinish;
}
 
Example 12
Source File: JobQueueInfo.java    From big-c with Apache License 2.0 4 votes vote down vote up
@InterfaceAudience.Private
public void setJobStatuses(org.apache.hadoop.mapreduce.JobStatus[] stats) {
  super.setJobStatuses(stats);
}
 
Example 13
Source File: EventCounter.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@InterfaceAudience.Private
public static long getFatal() {
  return counts.get(FATAL);
}
 
Example 14
Source File: NullContextWithUpdateThread.java    From big-c with Apache License 2.0 4 votes vote down vote up
/**
 * Do-nothing version of update
 */
@InterfaceAudience.Private
protected void update(MetricsRecordImpl record) {
}
 
Example 15
Source File: AvroSpecificSerialization.java    From big-c with Apache License 2.0 4 votes vote down vote up
@InterfaceAudience.Private
@Override
public boolean accept(Class<?> c) {
  return SpecificRecord.class.isAssignableFrom(c);
}
 
Example 16
Source File: Count.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * Should quotas get shown as part of the report?
 * @return if quotas should be shown then true otherwise false
 */
@InterfaceAudience.Private
boolean isShowQuotas() {
  return showQuotas;
}
 
Example 17
Source File: AvroSerialization.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
@InterfaceAudience.Private
public Serializer<T> getSerializer(Class<T> c) {
  return new AvroSerializer(c);
}
 
Example 18
Source File: JavaSerialization.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
@InterfaceAudience.Private
public Deserializer<Serializable> getDeserializer(Class<Serializable> c) {
  return new JavaSerializationDeserializer<Serializable>();
}
 
Example 19
Source File: SecurityUtil.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Resolves a host subject to the security requirements determined by
 * hadoop.security.token.service.use_ip.
 * 
 * @param hostname host or ip to resolve
 * @return a resolved host
 * @throws UnknownHostException if the host doesn't exist
 */
@InterfaceAudience.Private
public static
InetAddress getByName(String hostname) throws UnknownHostException {
  return hostResolver.getByName(hostname);
}
 
Example 20
Source File: Find.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Return the root expression for this find.
 * 
 * @return the root expression
 */
@InterfaceAudience.Private
Expression getRootExpression() {
  return this.rootExpression;
}