Examples of ObjectRegistry


Examples of org.apache.tez.runtime.api.ObjectRegistry

      kvWriter.write(word, new IntWritable(getContext().getTaskIndex()));
      ByteBuffer userPayload = getContext().getUserPayload().getPayload();
      if (userPayload != null) {
        boolean doLocalityCheck = getContext().getUserPayload().getPayload().get(0) > 0 ? true : false;
        if (doLocalityCheck) {
          ObjectRegistry objectRegistry = getContext().getObjectRegistry();
          String entry = String.valueOf(getContext().getTaskIndex());
          objectRegistry.cacheForDAG(entry, entry);
        }
      }
    }
View Full Code Here

Examples of org.apache.tez.runtime.api.ObjectRegistry

      System.out.println("Index: " + getContext().getTaskIndex() +
          " sum: " + sum + " expectedSum: " + expectedSum + " broadcastSum: " + broadcastSum);
      Preconditions.checkState((sum == expectedSum), "Sum = " + sum);     
     
      if (doLocalityCheck) {
        ObjectRegistry objectRegistry = getContext().getObjectRegistry();
        String index = (String) objectRegistry.get(String.valueOf(getContext().getTaskIndex()));
        if (index == null || Integer.valueOf(index).intValue() != getContext().getTaskIndex()) {
          String msg = "Did not find expected local producer "
              + getContext().getTaskIndex() + " in the same JVM";
          System.out.println(msg);
          throw new TezUncheckedException(msg);
View Full Code Here

Examples of org.apache.tez.runtime.common.objectregistry.ObjectRegistry

      vertexName = conf.get(
          org.apache.tez.mapreduce.hadoop.MRJobConfig.VERTEX_NAME);

      TaskAttemptID taId = context.getTaskAttemptID();

      ObjectRegistry objectRegistry = ObjectRegistryFactory.getObjectRegistry();
      String fooBarVal = (String) objectRegistry.get("FooBar");
      if (null == fooBarVal) {
        LOG.info("Adding FooBar key to Object cache");
        objectRegistry.add(ObjectLifeCycle.DAG,
            "FooBar", "BarFooFromTask" + taId.getTaskID().toString());
      } else {
        LOG.info("Got FooBar val from Object cache"
            + ", currentTaskId=" + taId.getTaskID().toString()
            + ", val=" + fooBarVal);
View Full Code Here

Examples of org.apache.tez.runtime.common.objectregistry.ObjectRegistry

      vertexName = conf.get(
          org.apache.tez.mapreduce.hadoop.MRJobConfig.VERTEX_NAME);

      TaskAttemptID taId = context.getTaskAttemptID();

      ObjectRegistry objectRegistry = ObjectRegistryFactory.getObjectRegistry();
      String fooBarVal = (String) objectRegistry.get("FooBar");
      if (null == fooBarVal) {
        LOG.info("Adding FooBar key to Object cache");
        objectRegistry.add(ObjectLifeCycle.DAG,
            "FooBar", "BarFooFromTask" + taId.getTaskID().toString());
      } else {
        LOG.info("Got FooBar val from Object cache"
            + ", currentTaskId=" + taId.getTaskID().toString()
            + ", val=" + fooBarVal);
View Full Code Here

Examples of org.apache.tez.runtime.common.objectregistry.ObjectRegistry

      vertexName = conf.get(
          org.apache.tez.mapreduce.hadoop.MRJobConfig.VERTEX_NAME);

      TaskAttemptID taId = context.getTaskAttemptID();

      ObjectRegistry objectRegistry = ObjectRegistryFactory.getObjectRegistry();
      String fooBarVal = (String) objectRegistry.get("FooBar");
      if (null == fooBarVal) {
        LOG.info("Adding FooBar key to Object cache");
        objectRegistry.add(ObjectLifeCycle.DAG,
            "FooBar", "BarFooFromTask" + taId.getTaskID().toString());
      } else {
        LOG.info("Got FooBar val from Object cache"
            + ", currentTaskId=" + taId.getTaskID().toString()
            + ", val=" + fooBarVal);
View Full Code Here

Examples of org.apache.tez.runtime.common.objectregistry.ObjectRegistry

  }

  @Test
  public void testBasicCRUD() {
    ObjectRegistry objectRegistry =
        ObjectRegistryFactory.getObjectRegistry();
    testCRUD(objectRegistry);
  }
View Full Code Here

Examples of org.apache.tez.runtime.common.objectregistry.ObjectRegistry

    testCRUD(objectRegistry);
  }

  @Test
  public void testClearCache() {
    ObjectRegistry objectRegistry = new ObjectRegistryImpl();
    testCRUD(objectRegistry);

    String one = "one";
    String two = "two";
    objectRegistry.add(ObjectLifeCycle.VERTEX, one, one);
    objectRegistry.add(ObjectLifeCycle.DAG, two, two);

    ((ObjectRegistryImpl)objectRegistry).clearCache(ObjectLifeCycle.VERTEX);
    Assert.assertNull(objectRegistry.get(one));
    Assert.assertNotNull(objectRegistry.get(two));

    objectRegistry.add(ObjectLifeCycle.VERTEX, one, one);
    ((ObjectRegistryImpl)objectRegistry).clearCache(ObjectLifeCycle.DAG);
    Assert.assertNotNull(objectRegistry.get(one));
    Assert.assertNull(objectRegistry.get(two));
  }
View Full Code Here

Examples of org.apache.woden.internal.util.ObjectRegistry

  /**
  * Serialize this node into the writer as XML.
  */
  public static void serializeAsXML(Node node, Writer writer)
  {
    ObjectRegistry namespaceStack = new ObjectRegistry();

    namespaceStack.register("xml", NS_URI_XML);

    PrintWriter pw = new PrintWriter(writer);
    String javaEncoding = (writer instanceof OutputStreamWriter)
                ? ((OutputStreamWriter) writer).getEncoding()
                : null;
View Full Code Here

Examples of org.apache.woden.internal.util.ObjectRegistry

        break;
      }

      case Node.ELEMENT_NODE :
      {
        namespaceStack = new ObjectRegistry(namespaceStack);

        out.print('<' + node.getNodeName());

        String elPrefix = node.getPrefix();
        String elNamespaceURI = node.getNamespaceURI();
View Full Code Here

Examples of org.apache.woden.internal.util.ObjectRegistry

    }

    public static void serializeAsXML(OMNode node, Writer writer)
    {

        ObjectRegistry namespaceStack = new ObjectRegistry();

        namespaceStack.register("xml", NS_URI_XML);

        PrintWriter pw = new PrintWriter(writer);
        String javaEncoding = (writer instanceof OutputStreamWriter)
        ? ((OutputStreamWriter) writer).getEncoding()
                : null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.