Examples of Stat


Examples of org.apache.zookeeper.data.Stat

    if (!secureZKAvailable) {
      return;
    }

    List<ACL> acls = zkw.getRecoverableZooKeeper().getZooKeeper()
        .getACL("/hbase/master", new Stat());
    assertEquals(acls.size(),2);

    boolean foundWorldReadableAcl = false;
    boolean foundHBaseOwnerAcl = false;
    for(int i = 0; i < 2; i++) {
View Full Code Here

Examples of org.apache.zookeeper.data.Stat

    if (!secureZKAvailable) {
      return;
    }

    List<ACL> acls = zkw.getRecoverableZooKeeper().getZooKeeper()
        .getACL("/hbase/hbaseid", new Stat());
    assertEquals(acls.size(),2);

    boolean foundWorldReadableAcl = false;
    boolean foundHBaseOwnerAcl = false;
    for(int i = 0; i < 2; i++) {
View Full Code Here

Examples of org.apache.zookeeper.data.Stat

      return;
    }

    ZKUtil.createWithParents(zkw, "/testACLNode");
    List<ACL> acls = zkw.getRecoverableZooKeeper().getZooKeeper()
        .getACL("/testACLNode", new Stat());
    assertEquals(acls.size(),1);
    assertEquals(acls.get(0).getId().getScheme(),"sasl");
    assertEquals(acls.get(0).getId().getId(),"hbase");
    assertEquals(acls.get(0).getPerms(), ZooDefs.Perms.ALL);
  }
View Full Code Here

Examples of org.apache.zookeeper.data.Stat

   * @throws KeeperException if unexpected zookeeper exception
   */
  public static boolean watchAndCheckExists(ZooKeeperWatcher zkw, String znode)
  throws KeeperException {
    try {
      Stat s = zkw.getRecoverableZooKeeper().exists(znode, zkw);
      boolean exists = s != null ? true : false;
      if (exists) {
        LOG.debug(zkw.prefix("Set watcher on existing znode " + znode));
      } else {
        LOG.debug(zkw.prefix(znode+" does not exist. Watcher is set."));
View Full Code Here

Examples of org.apache.zookeeper.data.Stat

   * @throws KeeperException if unexpected zookeeper exception
   */
  public static int checkExists(ZooKeeperWatcher zkw, String znode)
  throws KeeperException {
    try {
      Stat s = zkw.getRecoverableZooKeeper().exists(znode, null);
      return s != null ? s.getVersion() : -1;
    } catch (KeeperException e) {
      LOG.warn(zkw.prefix("Unable to set watcher on znode (" + znode + ")"), e);
      zkw.keeperException(e);
      return -1;
    } catch (InterruptedException e) {
View Full Code Here

Examples of org.apache.zookeeper_voltpatches.data.Stat

        ZooKeeper zk = VoltDB.instance().getHostMessenger().getZK();
        final String snapshotPath = VoltZK.completed_snapshots + "/" + txnId;

        boolean success = false;
        while (!success) {
            Stat stat = new Stat();
            byte data[] = null;
            try {
                data = zk.getData(snapshotPath, false, stat);
            } catch (KeeperException e) {
                if (e.code() == KeeperException.Code.NONODE) {
                    // If snapshot creation failed for some reason, the node won't exist. ignore
                    return;
                }
                VoltDB.crashLocalVoltDB("Failed to get snapshot completion node", true, e);
            } catch (InterruptedException e) {
                VoltDB.crashLocalVoltDB("Interrupted getting snapshot completion node", true, e);
            }
            if (data == null) {
                VoltDB.crashLocalVoltDB("Data should not be null if the node exists", false, null);
            }

            try {
                JSONObject jsonObj = new JSONObject(new String(data, Charsets.UTF_8));
                if (jsonObj.getLong("txnId") != txnId) {
                    VoltDB.crashLocalVoltDB("TxnId should match", false, null);
                }

                int hostCount = jsonObj.getInt("hostCount");
                // +1 because hostCount was initialized to -1
                jsonObj.put("hostCount", hostCount + participantCount + 1);
                zk.setData(snapshotPath, jsonObj.toString(4).getBytes(Charsets.UTF_8),
                        stat.getVersion());
            } catch (KeeperException.BadVersionException e) {
                continue;
            } catch (Exception e) {
                VoltDB.crashLocalVoltDB("This ZK call should never fail", true, e);
            }
View Full Code Here

Examples of org.luaj.vm2.ast.Stat

    }

    private boolean endsInReturn(Block block) {
      int n = block.stats.size();
      if ( n<=0 ) return false;
      Stat s = (Stat) block.stats.get(n-1);
      if ( s instanceof Return || s instanceof Break )
        return true;
      else if ( isInfiniteLoop( s ) )
        return true;
      else if ( s instanceof IfThenElse ) {
View Full Code Here

Examples of org.osm2world.core.target.statistics.StatisticsTarget.Stat

    perClassData[numClasses][0] = "TOTAL";
    comparators[0] = null;
   
    for (int col = 0; col < numColumns; ++col) {
     
      Stat stat = (col == 0) ? null : Stat.values()[col-1];
     
      if (col != 0) {
        columnNames[col] = statNames.get(stat);
        comparators[col] = LONG_COMPARATOR;
      }
View Full Code Here

Examples of org.osm2world.core.target.statistics.StatisticsTarget.Stat

    perClassData[numClasses][0] = "TOTAL";
    comparators[0] = null;
   
    for (int col = 0; col < numColumns; ++col) {
     
      Stat stat = (col == 0) ? null : Stat.values()[col-1];
     
      if (col != 0) {
        columnNames[col] = statNames.get(stat);
        comparators[col] = LONG_COMPARATOR;
      }
View Full Code Here

Examples of ucar.nc2.util.Stat


  public static void main(String[] args) {


    Stat v1 = new Stat();
    Stat raf = new Stat();

    long total;
    File topDir = new File("C:/data/conventions/");

    try {
      //SPFactory.setServiceProvider("ucar.nc2.SPNioMMap");
      //readAllData("C:/data/conventions/csm/B06.62.atm.0703.nc", null);

      //SPFactory.setServiceProvider("ucar.nc2.SPNioMMap");
      //total = doOneDirRecord(topDir, mm);
      //System.out.println("total bytes= "+total);

      ///SPFactory.setServiceProvider("ucar.nc2.SPNioCD");
      //total = doOneDirRecord(topDir, cd);
      //System.out.println("total bytes= "+total);

      int n = 10;

      SPFactory.setServiceProvider("ucar.nc2.N3ver1");
      total = readSpreadData("C:/data/conventions/mm5/copy_n040.nc", v1, n);
      System.out.println("total bytes= "+total);

      SPFactory.setServiceProvider("ucar.nc2.iosp.netcdf3.N3raf");
      total = readSpreadData("C:/data/conventions/mm5/n040.nc", raf, n);
      System.out.println("total bytes= "+total);

      SPFactory.setServiceProvider("ucar.nc2.N3ver1");
      total = doOneDir(topDir, v1);
      System.out.println("total bytes= "+total); // */
     
      SPFactory.setServiceProvider("ucar.nc2.iosp.netcdf3.N3raf");
      total = doOneDir(topDir, raf);
      System.out.println("total bytes= "+total);

      /* SPFactory.setServiceProvider("ucar.nc2.SPnioMMap");
      total = doOneDir(topDir, mm);
      System.out.println("total bytes= "+total);

      SPFactory.setServiceProvider("ucar.nc2.SPnioCD");
      total = doOneDir(topDir, cd);
      System.out.println("total bytes= "+total); */


      /* SPFactory.setServiceProvider("ucar.nc2.SPnioMMap");
      total = readSpreadData("C:/data/conventions/mm5/copy2_n040.nc", mm, n);
      System.out.println("total bytes= "+total);

      SPFactory.setServiceProvider("ucar.nc2.SPnioCD");
      total = readSpreadData("C:/data/conventions/mm5/n040.nc", cd, n);
      System.out.println("total bytes= "+total); */


    } catch (Exception e) {
      e.printStackTrace();
    }

    System.out.print("Ver1=");
    v1.print();
    System.out.print("Raf=");
    raf.print();


    /*
    doit(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.