Examples of Packager


Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

   * @see #REPLY_OK
   */
  protected int deliverAgent(byte[] data, Node from)
  {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null)
    {
      return SimpleP2P.REPLY_ERROR;
    }

View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

   * @return success or failure of this operation
   * @see de.tuclausthal.informatik.winf.mobileagents.p2p.P2PNetwork#sendAgent(de.tuclausthal.informatik.winf.mobileagents.p2p.Node, de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo)
   */
  public boolean sendAgent(Node toNode, AgentInfo agent)
  {
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    byte[] data = p.packageAgent(agent);
    return this.sendAgent(toNode, data);
  }
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

   * @see #REPLY_OK
   */
  protected int deliverAgent(byte[] data, Node from)
  {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null)
    {
      return SimpleP2P.REPLY_ERROR;
    }

View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

   * @return success or failure of this operation
   * @see de.tuclausthal.informatik.winf.mobileagents.p2p.P2PNetwork#sendAgent(de.tuclausthal.informatik.winf.mobileagents.p2p.Node, de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo)
   */
  public boolean sendAgent(Node toNode, AgentInfo agent)
  {
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    byte[] data = p.packageAgent(agent);
    return this.sendAgent(toNode, data);
  }
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

  @Override
  public boolean sendAgent(Node toNode, AgentInfo agent) {
    if (!toNode.isOnline()) {
      return false;
    }
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    byte[] data = p.packageAgent(agent);
    String path = fh.packInFile(data);
    po.ServSendFile(po.PurpleAccountGetConnection(account), toNode
        .getNodeName(), path);
    FileCleaner fc = new FileCleaner("Cleaner of " + path, path,
        Thread.MIN_PRIORITY, Config.getInstance()
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

   * @see #REPLY_ERROR
   * @see #REPLY_OK
   */
  protected int deliverAgent(byte[] data, Node from) {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null) {
      return this.REPLY_ERROR;
    }

    // update AgentInfo
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

                    .getName()
                    .replace(
                        "de.uniol.informatik.vlba.prototype.agent.",
                        "") + "_" + Math.random());
      ai.setAgentName(b.getName());
      Packager p = PackagingManager.getInstance()
          .getPackager("StateOnly");
      ai.setPackager(p);
      ai.setSecurityPolicy(new EverythingAllowedPolicy());
      SecurityPolicyManager.getInstance().assignSecurityPolicy(ai);
      System.out.println("registered bee: " + b.getName());
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

                    .getName()
                    .replace(
                        "de.uniol.informatik.vlba.prototype.agent.",
                        "") + "_" + Math.random());
      ai.setAgentName(b.getName());
      Packager p = PackagingManager.getInstance()
          .getPackager("StateOnly");
      ai.setPackager(p);
      ai.setSecurityPolicy(new EverythingAllowedPolicy());
      SecurityPolicyManager.getInstance().assignSecurityPolicy(ai);
      System.out.println("registered bee: " + b.getName());
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager

    private void mergeOneReducePlanWithIndex(PhysicalPlan from,
            PhysicalPlan to, int initial, int current, byte mapKeyType) throws VisitorException {
        POPackage pk = (POPackage)from.getRoots().get(0);
        from.remove(pk);
        Packager fromPkgr = pk.getPkgr();

        if (!(fromPkgr instanceof MultiQueryPackager)) {
            // XXX the index of the original keyInfo map is always 0,
            // we need to shift the index so that the lookups works
            // with the new indexed key
            addShiftedKeyInfoIndex(initial, fromPkgr);
        }

        int total = current - initial;

        MultiQueryPackager toPkgr = (MultiQueryPackager) ((POPackage) to
                .getRoots().get(0)).getPkgr();
        int pkCount = 0;
        if (fromPkgr instanceof MultiQueryPackager) {
            List<Packager> pkgs = ((MultiQueryPackager) fromPkgr)
                    .getPackagers();
            for (Packager p : pkgs) {
                ((MultiQueryPackager) toPkgr).addPackager(p);
                pkCount++;
            }
            toPkgr.addIsKeyWrappedList(((MultiQueryPackager) fromPkgr)
                            .getIsKeyWrappedList());
            addShiftedKeyInfoIndex(initial, current,
                    (MultiQueryPackager) fromPkgr);
        } else {
            toPkgr.addPackager(fromPkgr, mapKeyType);
            pkCount = 1;
        }

        if (pkCount != total) {
            int errCode = 2146;
            String msg = "Internal Error. Inconsistency in key index found during optimization.";
            throw new OptimizerException(msg, errCode, PigException.BUG);
        }

        PODemux demux = (PODemux)to.getLeaves().get(0);
        int plCount = 0;
        PhysicalOperator root = from.getRoots().get(0);
        if (root instanceof PODemux) {
            // flattening the inner plans of the demux operator.
            // This is based on the fact that if a plan has a demux
            // operator, then it's the only operator in the plan.
            List<PhysicalPlan> pls = ((PODemux)root).getPlans();
            for (PhysicalPlan pl : pls) {
                demux.addPlan(pl);
                plCount++;
            }
        } else {
            demux.addPlan(from);
            plCount = 1;
        }

        if (plCount != total) {
            int errCode = 2146;
            String msg = "Internal Error. Inconsistency in key index found during optimization.";
            throw new OptimizerException(msg, errCode, PigException.BUG);
        }

        if (toPkgr.isSameMapKeyType()) {
            toPkgr.setKeyType(fromPkgr.getKeyType());
        } else {
            toPkgr.setKeyType(DataType.TUPLE);
        }
    }
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager

            throw new OptimizerException(msg, errCode, PigException.BUG);
        }
        int i = 0;
        int curIndex = initialIndex;
        while (i < end) {
            Packager pkg = pkgs.get(i);
            addShiftedKeyInfoIndex(curIndex, pkg);
            curIndex++;
            i++;
        }
        return curIndex; // could be used in a caller who recursively called this function
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.