当前位置: 首页>>代码示例>>Java>>正文


Java TimelineClient.createTimelineClient方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.client.api.TimelineClient.createTimelineClient方法的典型用法代码示例。如果您正苦于以下问题:Java TimelineClient.createTimelineClient方法的具体用法?Java TimelineClient.createTimelineClient怎么用?Java TimelineClient.createTimelineClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.client.api.TimelineClient的用法示例。


在下文中一共展示了TimelineClient.createTimelineClient方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renew

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token, Configuration conf) throws IOException,
    InterruptedException {
  TimelineClient client = TimelineClient.createTimelineClient();
  try {
    client.init(conf);
    client.start();
    return client.renewDelegationToken(
        (Token<TimelineDelegationTokenIdentifier>) token);
  } catch (YarnException e) {
    throw new IOException(e);
  } finally {
    client.stop();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TimelineDelegationTokenIdentifier.java

示例2: cancel

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void cancel(Token<?> token, Configuration conf) throws IOException,
    InterruptedException {
  TimelineClient client = TimelineClient.createTimelineClient();
  try {
    client.init(conf);
    client.start();
    client.cancelDelegationToken(
        (Token<TimelineDelegationTokenIdentifier>) token);
  } catch (YarnException e) {
    throw new IOException(e);
  } finally {
    client.stop();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TimelineDelegationTokenIdentifier.java

示例3: serviceInit

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
  publishSystemMetrics =
      conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
          YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED) &&
      conf.getBoolean(YarnConfiguration.RM_SYSTEM_METRICS_PUBLISHER_ENABLED,
          YarnConfiguration.DEFAULT_RM_SYSTEM_METRICS_PUBLISHER_ENABLED);

  if (publishSystemMetrics) {
    client = TimelineClient.createTimelineClient();
    addIfService(client);

    dispatcher = createDispatcher(conf);
    dispatcher.register(SystemMetricsEventType.class,
        new ForwardingEventHandler());
    addIfService(dispatcher);
    LOG.info("YARN system metrics publishing service is enabled");
  } else {
    LOG.info("YARN system metrics publishing service is not enabled");
  }
  super.serviceInit(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:SystemMetricsPublisher.java

示例4: prepareTimelineDomain

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
private void prepareTimelineDomain() {
  TimelineClient timelineClient = null;
  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
      YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
    timelineClient.start();
  } else {
    LOG.warn("Cannot put the domain " + domainId +
        " because the timeline service is not enabled");
    return;
  }
  try {
    //TODO: we need to check and combine the existing timeline domain ACLs,
    //but let's do it once we have client java library to query domains.
    TimelineDomain domain = new TimelineDomain();
    domain.setId(domainId);
    domain.setReaders(
        viewACLs != null && viewACLs.length() > 0 ? viewACLs : " ");
    domain.setWriters(
        modifyACLs != null && modifyACLs.length() > 0 ? modifyACLs : " ");
    timelineClient.putDomain(domain);
    LOG.info("Put the timeline domain: " +
        TimelineUtils.dumpTimelineRecordtoJSON(domain));
  } catch (Exception e) {
    LOG.error("Error when putting the timeline domain", e);
  } finally {
    timelineClient.stop();
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:Client.java

示例5: serviceInit

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void serviceInit(Configuration conf) throws Exception {
  asyncApiPollIntervalMillis =
      conf.getLong(YarnConfiguration.YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS,
        YarnConfiguration.DEFAULT_YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS);
  asyncApiPollTimeoutMillis =
      conf.getLong(YarnConfiguration.YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_TIMEOUT_MS,
          YarnConfiguration.DEFAULT_YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_TIMEOUT_MS);
  submitPollIntervalMillis = asyncApiPollIntervalMillis;
  if (conf.get(YarnConfiguration.YARN_CLIENT_APP_SUBMISSION_POLL_INTERVAL_MS)
      != null) {
    submitPollIntervalMillis = conf.getLong(
      YarnConfiguration.YARN_CLIENT_APP_SUBMISSION_POLL_INTERVAL_MS,
      YarnConfiguration.DEFAULT_YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS);
  }

  if (conf.getBoolean(YarnConfiguration.APPLICATION_HISTORY_ENABLED,
    YarnConfiguration.DEFAULT_APPLICATION_HISTORY_ENABLED)) {
    historyServiceEnabled = true;
    historyClient = AHSClient.createAHSClient();
    historyClient.init(conf);
  }

  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
      YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    timelineServiceEnabled = true;
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
    timelineDTRenewer = getTimelineDelegationTokenRenewer(conf);
    timelineService = TimelineUtils.buildTimelineTokenService(conf);
  }
  super.serviceInit(conf);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:35,代码来源:YarnClientImpl.java

示例6: prepareTimelineDomain

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
private void prepareTimelineDomain() {
  TimelineClient timelineClient = null;
  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
          YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
    timelineClient.start();
  } else {
    LOG.warn("Cannot put the domain " + domainId +
            " because the timeline service is not enabled");
    return;
  }
  try {
    TimelineDomain domain = new TimelineDomain();
    domain.setId(domainId);
    domain.setReaders(
            viewACLs != null && viewACLs.length() > 0 ? viewACLs : " ");
    domain.setWriters(
            modifyACLs != null && modifyACLs.length() > 0 ? modifyACLs : " ");
    timelineClient.putDomain(domain);
    LOG.info("Put the timeline domain: " +
            TimelineUtils.dumpTimelineRecordtoJSON(domain));
  } catch (Exception e) {
    LOG.error("Error when putting the timeline domain", e);
  } finally {
    timelineClient.stop();
  }
}
 
开发者ID:apache,项目名称:metron,代码行数:29,代码来源:Client.java

示例7: serviceInit

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@Override
public void serviceInit(Configuration conf) throws Exception {
  LOG.info("Initializing ATSService");
  timelineClient = TimelineClient.createTimelineClient();
  timelineClient.init(conf);
  maxTimeToWaitOnShutdown = conf.getLong(
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS,
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS_DEFAULT);
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:10,代码来源:ATSHistoryLoggingService.java

示例8: initializeTimelineClient

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
private void initializeTimelineClient() {
  if (this.conf == null) {
    throw new TezUncheckedException("ATSACLManager not configured");
  }
  if (timelineClient != null) {
    this.timelineClient.stop();
    this.timelineClient = null;
  }
  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
    YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    this.timelineClient = TimelineClient.createTimelineClient();
    this.timelineClient.init(this.conf);
    this.timelineClient.start();
  } else {
    this.timelineClient = null;
    if (conf.get(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, "")
       .equals(atsHistoryLoggingServiceClassName)) {
      LOG.warn(atsHistoryLoggingServiceClassName
          + " is disabled due to Timeline Service being disabled, "
          + YarnConfiguration.TIMELINE_SERVICE_ENABLED + " set to false");
    }
  }
  try {
    this.user = UserGroupInformation.getCurrentUser().getShortUserName();
  } catch (IOException e) {
    throw new TezUncheckedException("Unable to get Current User UGI", e);
  }
}
 
开发者ID:apache,项目名称:tez,代码行数:29,代码来源:ATSV15HistoryACLPolicyManager.java

示例9: prepareTimelineDomain

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
private void prepareTimelineDomain() {
    TimelineClient timelineClient = null;
    if (jstormClientContext.conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
            YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
        timelineClient = TimelineClient.createTimelineClient();
        timelineClient.init(jstormClientContext.conf);
        timelineClient.start();
    } else {
        LOG.warn("Cannot put the domain " + jstormClientContext.domainId +
                " because the timeline service is not enabled");
        return;
    }
    try {
        TimelineDomain domain = new TimelineDomain();
        domain.setId(jstormClientContext.domainId);
        domain.setReaders(
                jstormClientContext.viewACLs != null && jstormClientContext.viewACLs.length() > 0 ? jstormClientContext.viewACLs : JOYConstants.BLANK);
        domain.setWriters(
                jstormClientContext.modifyACLs != null && jstormClientContext.modifyACLs.length() > 0 ? jstormClientContext.modifyACLs : JOYConstants.BLANK);
        timelineClient.putDomain(domain);
        LOG.info("Put the timeline domain: " +
                TimelineUtils.dumpTimelineRecordtoJSON(domain));
    } catch (Exception e) {
        LOG.error("Error when putting the timeline domain", e);
    } finally {
        timelineClient.stop();
    }
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:29,代码来源:JstormOnYarn.java

示例10: createTimelineClientForUGI

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
private TimelineClient createTimelineClientForUGI() {
  TimelineClient client = TimelineClient.createTimelineClient();
  client.init(conf);
  client.start();
  return client;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestTimelineAuthenticationFilter.java

示例11: createTimelineClient

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
TimelineClient createTimelineClient() throws IOException, YarnException {
  return TimelineClient.createTimelineClient();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:YarnClientImpl.java

示例12: serviceInit

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@Override
public void serviceInit(Configuration serviceConf) throws Exception {
  Configuration conf = new Configuration(serviceConf);

  String summaryEntityTypesStr = EntityTypes.TEZ_APPLICATION
      + "," + EntityTypes.TEZ_APPLICATION_ATTEMPT
      + "," + EntityTypes.TEZ_DAG_ID;

  // Ensure that summary entity types are defined properly for Tez.
  if (conf.getBoolean(TezConfiguration.TEZ_AM_ATS_V15_OVERRIDE_SUMMARY_TYPES,
      TezConfiguration.TEZ_AM_ATS_V15_OVERRIDE_SUMMARY_TYPES_DEFAULT)) {
    conf.set(YarnConfiguration.TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_SUMMARY_ENTITY_TYPES,
        summaryEntityTypesStr);
  }

  historyLoggingEnabled = conf.getBoolean(TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED,
      TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED_DEFAULT);
  if (!historyLoggingEnabled) {
    LOG.info("ATSService: History Logging disabled. "
        + TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED + " set to false");
    return;
  }

  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
    YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
  } else {
    this.timelineClient = null;
    if (conf.get(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, "")
      .equals(atsHistoryLoggingServiceClassName)) {
      LOG.warn(atsHistoryLoggingServiceClassName
          + " is disabled due to Timeline Service being disabled, "
          + YarnConfiguration.TIMELINE_SERVICE_ENABLED + " set to false");
    }
  }
  maxTimeToWaitOnShutdown = conf.getLong(
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS,
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS_DEFAULT);
  maxPollingTimeMillis = conf.getInt(
      TezConfiguration.YARN_ATS_MAX_POLLING_TIME_PER_EVENT,
      TezConfiguration.YARN_ATS_MAX_POLLING_TIME_PER_EVENT_DEFAULT);
  if (maxTimeToWaitOnShutdown < 0) {
    waitForeverOnShutdown = true;
  }

  LOG.info("Initializing " + ATSV15HistoryLoggingService.class.getSimpleName() + " with "
      + ", maxPollingTime(ms)=" + maxPollingTimeMillis
      + ", waitTimeForShutdown(ms)=" + maxTimeToWaitOnShutdown
      + ", TimelineACLManagerClass=" + atsHistoryACLManagerClassName);

  try {
    historyACLPolicyManager = ReflectionUtils.createClazzInstance(
        atsHistoryACLManagerClassName);
    historyACLPolicyManager.setConf(conf);
  } catch (TezReflectionException e) {
    LOG.warn("Could not instantiate object for " + atsHistoryACLManagerClassName
        + ". ACLs cannot be enforced correctly for history data in Timeline", e);
    if (!conf.getBoolean(TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS,
        TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS_DEFAULT)) {
      throw e;
    }
    historyACLPolicyManager = null;
  }

  numDagsPerGroup = conf.getInt(TezConfiguration.TEZ_HISTORY_LOGGING_TIMELINE_NUM_DAGS_PER_GROUP,
      TezConfiguration.TEZ_HISTORY_LOGGING_TIMELINE_NUM_DAGS_PER_GROUP_DEFAULT);
}
 
开发者ID:apache,项目名称:tez,代码行数:69,代码来源:ATSV15HistoryLoggingService.java

示例13: serviceInit

import org.apache.hadoop.yarn.client.api.TimelineClient; //导入方法依赖的package包/类
@Override
public void serviceInit(Configuration conf) throws Exception {
  historyLoggingEnabled = conf.getBoolean(TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED,
      TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED_DEFAULT);
  if (!historyLoggingEnabled) {
    LOG.info("ATSService: History Logging disabled. "
        + TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED + " set to false");
    return;
  }

  if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
    YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
  } else {
    this.timelineClient = null;
    if (conf.get(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, "")
      .equals(atsHistoryLoggingServiceClassName)) {
      LOG.warn(atsHistoryLoggingServiceClassName
          + " is disabled due to Timeline Service being disabled, "
          + YarnConfiguration.TIMELINE_SERVICE_ENABLED + " set to false");
    }
  }
  maxTimeToWaitOnShutdown = conf.getLong(
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS,
      TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS_DEFAULT);
  maxEventsPerBatch = conf.getInt(
      TezConfiguration.YARN_ATS_MAX_EVENTS_PER_BATCH,
      TezConfiguration.YARN_ATS_MAX_EVENTS_PER_BATCH_DEFAULT);
  maxPollingTimeMillis = conf.getInt(
      TezConfiguration.YARN_ATS_MAX_POLLING_TIME_PER_EVENT,
      TezConfiguration.YARN_ATS_MAX_POLLING_TIME_PER_EVENT_DEFAULT);
  if (maxTimeToWaitOnShutdown < 0) {
    waitForeverOnShutdown = true;
  }

  LOG.info("Initializing " + ATSHistoryLoggingService.class.getSimpleName() + " with "
    + "maxEventsPerBatch=" + maxEventsPerBatch
    + ", maxPollingTime(ms)=" + maxPollingTimeMillis
    + ", waitTimeForShutdown(ms)=" + maxTimeToWaitOnShutdown
    + ", TimelineACLManagerClass=" + atsHistoryACLManagerClassName);

  try {
    historyACLPolicyManager = ReflectionUtils.createClazzInstance(
        atsHistoryACLManagerClassName);
    historyACLPolicyManager.setConf(conf);
  } catch (TezReflectionException e) {
    LOG.warn("Could not instantiate object for " + atsHistoryACLManagerClassName
        + ". ACLs cannot be enforced correctly for history data in Timeline", e);
    if (!conf.getBoolean(TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS,
        TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS_DEFAULT)) {
      throw e;
    }
    historyACLPolicyManager = null;
  }

}
 
开发者ID:apache,项目名称:tez,代码行数:58,代码来源:ATSHistoryLoggingService.java


注:本文中的org.apache.hadoop.yarn.client.api.TimelineClient.createTimelineClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。