Examples of PolicyInfo


Examples of org.apache.hadoop.raid.protocol.PolicyInfo

    Configuration newConf = new Configuration(conf);
    RaidNode.createChecksumStore(newConf, true);
    Path raidDir = new Path("/raidtest/1");
    HashMap<Codec, Long[]> fileCRCs = new HashMap<Codec, Long[]>();
    HashMap<Codec, Path> filePaths = new HashMap<Codec, Path>();
    PolicyInfo info = new PolicyInfo();
    info.setProperty("targetReplication", Integer.toString(targetReplication));
    info.setProperty("metaReplication", Integer.toString(metaReplication));
    try {
      createTestFiles(raidDir, filePaths, fileCRCs, null);
      LOG.info("Test testLargeFailureRateEncoding created test files");
      // create the InjectionHandler
      for (Codec codec: Codec.getCodecs()) {
        Path filePath = filePaths.get(codec);
        FileStatus stat = fileSys.getFileStatus(filePath);
        info.setCodecId(codec.id);
        boolean succeed = false;
        TestEncodingHandler h = new TestEncodingHandler(0.5, null, false);
        InjectionHandler.set(h);
        succeed = runEncodingTasks(newConf, codec, stat, info, 100);
        assertTrue("We should succeed", succeed);
View Full Code Here

Examples of org.apache.hadoop.raid.protocol.PolicyInfo

      FileSystem fs = srcs.getFileSystem(job);

      List<FileSplit> splits = new ArrayList<FileSplit>(numSplits);

      Text key = new Text();
      PolicyInfo value = new PolicyInfo();
      SequenceFile.Reader in = null;
      long prev = 0L;
      int count = 0; // count src
      try {
        for (in = new SequenceFile.Reader(fs, srcs, job); in.next(key, value);) {
View Full Code Here

Examples of org.apache.hadoop.raid.protocol.PolicyInfo

          purgeCode(c);
          try {
            // re-generate the parity files for modified sources.
            if (modifiedSource.size() > 0) {
              LOG.info("re-generate parity files");
              PolicyInfo info = raidNode.determinePolicy(c);
              // check if we should raid the files/directories.
              for (Iterator<FileStatus> it = modifiedSource.iterator();
                      it.hasNext();) {
                FileStatus stat = it.next();
                if (!RaidNode.shouldRaid(conf,
View Full Code Here

Examples of org.apache.imperius.spl.core.PolicyInfo

          !arrayOfInstancesParamSizeGreaterThanZero)
      {
       
        logger.fine(Thread.currentThread().getName() + "no instances passed evaluating against all");
       
        PolicyInfo policyInfo=this._policyManager.getPolicyInfo(policyRuleName);
       
        Map classQuaifierMap=policyInfo.getClassQualifierMap();
        Iterator classit=classQuaifierMap.keySet().iterator();
       
        if(classQuaifierMap.size()==0 || classQuaifierMap.size()>1)
        {
          logger.severe(Thread.currentThread().getName() + "Multiple Import classes not supported in CIM-SPL");
View Full Code Here

Examples of org.apache.imperius.spl.core.PolicyInfo

  public PolicyInfo getPolicyInfo(String policyName) throws SPLException
  {
    logger.entering(sourceClass, Thread.currentThread().getName() + " "  + "getPolicyInfo");
   
    PolicyInfo pi = this._policyDataStore.getPolicyInfo(policyName);
   
    logger.exiting(sourceClass, Thread.currentThread().getName() + " " + "getPolicyInfo");

    return pi;
  }
View Full Code Here

Examples of org.apache.imperius.spl.core.PolicyInfo

        List importStmtList = policyObject.getImportStmtList();

        logger.exiting(sourceClass, Thread.currentThread().getName()
            + " " + "getPolicyInfo");
       
        PolicyInfo pi = new PolicyInfoImpl(importStmtList);
        return pi;
      }
      else if (_policyRepository.policyExists(policyRuleName))
      {
        String PolicyString = _policyRepository.getPolicyString(policyRuleName);

        SPLPolicy internalPolicyObject = _policyParser.createInternalPolicyObject(policyRuleName, PolicyString);
        _policyCache.insertPolicy(policyRuleName, internalPolicyObject);
       
        List importStmtList = internalPolicyObject.getImportStmtList();
        PolicyInfo pi = new PolicyInfoImpl(importStmtList);

        logger.exiting(sourceClass, Thread.currentThread().getName()
            + " " + "getPolicyInfo");

        return pi;
View Full Code Here

Examples of org.apache.imperius.spl.core.PolicyInfo

    Integer retVal=new Integer(-1);
    System.out.println("executePolicy client SPL policy "+policyName);
     

    System.out.println(" no instances passed in , evaluating against all instances");
    PolicyInfo policyInfo=this._policyManager.getPolicyInfo(policyName);
    Map classQuaifierMap=policyInfo.getClassQualifierMap();
    Iterator classit=classQuaifierMap.keySet().iterator();
    System.out.println("number of classes in policy = "+classQuaifierMap.size());

    if(classQuaifierMap.size()==0 || classQuaifierMap.size()>1)
    {
View Full Code Here

Examples of org.apache.synapse.util.PolicyInfo

                OMAttribute operationNS = policy.getAttribute(
                        new QName(XMLConfigConstants.NULL_NAMESPACE, "operationNamespace"));

                if (key != null) {

                    PolicyInfo pi = new PolicyInfo(key.getAttributeValue());

                    if (type != null && type.getAttributeValue() != null) {
                        if ("in".equals(type.getAttributeValue())) {
                            pi.setType(PolicyInfo.MESSAGE_TYPE_IN);
                        } else if ("out".equals(type.getAttributeValue())) {
                            pi.setType(PolicyInfo.MESSAGE_TYPE_OUT);
                        } else {
                            handleException("Undefined policy type for the policy with key : "
                                    + key.getAttributeValue());
                        }
                    }

                    if (operationName != null && operationName.getAttributeValue() != null) {
                        if (operationNS != null && operationNS.getAttributeValue() != null) {
                            pi.setOperation(new QName(operationNS.getAttributeValue(),
                                    operationName.getAttributeValue()));
                        } else {
                            pi.setOperation(new QName(operationName.getAttributeValue()));
                        }
                    }

                    proxy.addPolicyInfo(pi);
View Full Code Here

Examples of org.apache.synapse.util.PolicyInfo

                Resource servicePoliciesResource = registry.get(servicePoliciesPath);
                if (servicePoliciesResource instanceof Collection) {
                    Collection servicePoliciesCollection = (Collection) servicePoliciesResource;
                    for (String servicePolicyResourcePath :
                            servicePoliciesCollection.getChildren()) {
                        PolicyInfo pi = handlePolicy(config,
                                proxyService, servicePolicyResourcePath, (UserRegistry) registry);
                        if (pi != null) {
                            pi.setPolicyKey("conf:" + pi.getPolicyKey());
                            proxyService.addPolicyInfo(pi);
                        }
                    }
                }
            }
View Full Code Here

Examples of org.apache.synapse.util.PolicyInfo

                    if (proxyPolicy.equal(policy.normalize(false))) {
                        return null;
                    }
                }
            }
            return new PolicyInfo(policyPath);
        }
        return 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.