Package co.cask.cdap.internal.app.runtime

Examples of co.cask.cdap.internal.app.runtime.MetricsFieldSetter


                                                                                     processorName,
                                                                                     runnableName));

      //Injecting Metrics
      Reflections.visit(runnable, runnableType,
                        new MetricsFieldSetter(new ServiceRunnableMetrics(metricsCollectionService,
                                                                          program.getApplicationId(),
                                                                          serviceSpec.getName(), runnableName,
                                                                          twillContext.getInstanceId())),
                        new PropertyFieldSetter(runnableSpec.getRunnableSpecification().getConfigs()));
View Full Code Here


      } else {
        delegate = (TwillRunnable) new InstantiatorFactory(false).get(TypeToken.of(clz)).create();
      }

      Reflections.visit(delegate, TypeToken.of(delegate.getClass()),
                        new MetricsFieldSetter(new ServiceRunnableMetrics(metricsCollectionService,
                                                                          program.getApplicationId(),
                                                                          program.getName(), runnableName,
                                                                          context.getInstanceId())),
                        new PropertyFieldSetter(runtimeSpec.getRunnableSpecification().getConfigs()));
View Full Code Here

      // injecting runtime components, like datasets, etc.
      try {
        Reflections.visit(delegate, TypeToken.of(delegate.getClass()),
                          new PropertyFieldSetter(basicMapReduceContext.getSpecification().getProperties()),
                          new MetricsFieldSetter(basicMapReduceContext.getMetrics()),
                          new DataSetFieldSetter(basicMapReduceContext));
      } catch (Throwable t) {
        LOG.error("Failed to inject fields to {}.", delegate.getClass(), t);
        throw Throwables.propagate(t);
      }
View Full Code Here

                                                                               cConfiguration,
                                                                               discoveryServiceClient,
                                                                               transactionSystemClient);

      HttpServiceHandler handler = instantiatorFactory.get(handlerType).create();
      Reflections.visit(handler, handlerType, new MetricsFieldSetter(metrics),
                        new DataSetFieldSetter(httpServiceContext));
      initHandler(handler, httpServiceContext);
      HandlerContextPair handlerContextPair = new HandlerContextPair(handler, httpServiceContext);
      supplier = Suppliers.ofInstance(handlerContextPair);
View Full Code Here

    InstantiatorFactory factory = new InstantiatorFactory(false);
    try {
      TypeToken<?> type = TypeToken.of(programClassLoader.loadClass(serviceClassName));
      worker = (ServiceWorker) factory.get(type).create();
      Reflections.visit(worker, type, new MetricsFieldSetter(metrics),
                                      new PropertyFieldSetter(runnableArgs));
      if (worker instanceof GuavaServiceWorker) {
        String delegateClassName = runnableArgs.get("delegate.class.name");
        type = TypeToken.of(programClassLoader.loadClass(delegateClassName));
        ((GuavaServiceWorker) worker).setDelegate((Service) factory.get(type).create());
View Full Code Here

      // Inject DataSet, OutputEmitter, Metric fields
      Reflections.visit(flowlet, TypeToken.of(flowlet.getClass()),
                        new PropertyFieldSetter(flowletDef.getFlowletSpec().getProperties()),
                        new DataSetFieldSetter(flowletContext),
                        new MetricsFieldSetter(flowletContext.getMetrics()),
                        new OutputEmitterFieldSetter(outputEmitterFactory(flowletContext, flowletName,
                                                                          dataFabricFacade, queueSpecs)));

      ImmutableList.Builder<ConsumerSupplier<?>> queueConsumerSupplierBuilder = ImmutableList.builder();
      Collection<ProcessSpecification> processSpecs =
View Full Code Here

      TypeToken<? extends Procedure> procedureType = TypeToken.of(program.<Procedure>getMainClass());
      procedure = new InstantiatorFactory(false).get(procedureType).create();
      Reflections.visit(procedure, TypeToken.of(procedure.getClass()),
                        new PropertyFieldSetter(context.getSpecification().getProperties()),
                        new DataSetFieldSetter(context),
                        new MetricsFieldSetter(context.getMetrics()));

      handlers = createHandlerMethods(procedure, procedureType, dataFabricFacade);

      // TODO: It's a bit hacky, since we know there is one instance per execution handler thread.
      LoggingContextAccessor.setLoggingContext(context.getLoggingContext());
View Full Code Here

      // injecting runtime components, like datasets, etc.
      try {
        Reflections.visit(delegate, TypeToken.of(delegate.getClass()),
                          new PropertyFieldSetter(basicMapReduceContext.getSpecification().getProperties()),
                          new MetricsFieldSetter(basicMapReduceContext.getMetrics()),
                          new DataSetFieldSetter(basicMapReduceContext));
      } catch (Throwable t) {
        LOG.error("Failed to inject fields to {}.", delegate.getClass(), t);
        throw Throwables.propagate(t);
      }
View Full Code Here

TOP

Related Classes of co.cask.cdap.internal.app.runtime.MetricsFieldSetter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.