Package org.apache.accumulo.fate.zookeeper.ZooReaderWriter

Examples of org.apache.accumulo.fate.zookeeper.ZooReaderWriter.Mutator


  static void removeIterators(final long txid, String tableId) throws Exception {
    String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_COMPACT_ID;
   
    IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
   
    zoo.mutate(zTablePath, null, null, new Mutator() {
      @Override
      public byte[] mutate(byte[] currentValue) throws Exception {
        String cvs = new String(currentValue);
        String[] tokens = cvs.split(",");
        long flushID = Long.parseLong(new String(tokens[0]));
View Full Code Here


    try {
      Utils.checkTableDoesNotExist(instance, newTableName, tableId, TableOperation.RENAME);
     
      final String tap = ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAME;
     
      zoo.mutate(tap, null, null, new Mutator() {
        public byte[] mutate(byte[] current) throws Exception {
          final String currentName = new String(current);
          if (currentName.equals(newTableName))
            return null; // assume in this case the operation is running again, so we are done
          if (!currentName.equals(oldTableName)) {
View Full Code Here

   
    String cvs = new String(currentValue);
    String[] tokens = cvs.split(",");
    final long flushID = Long.parseLong(new String(tokens[0]));
   
    zoo.mutate(zCancelID, null, null, new Mutator() {
      @Override
      public byte[] mutate(byte[] currentValue) throws Exception {
        long cid = Long.parseLong(new String(currentValue));
       
        if (cid < flushID)
View Full Code Here

 
  public synchronized void transitionTableState(final String tableId, final TableState newState) {
    String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE;
   
    try {
      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(), ZooUtil.PUBLIC, new Mutator() {
        @Override
        public byte[] mutate(byte[] oldData) throws Exception {
          TableState oldState = TableState.UNKNOWN;
          if (oldData != null)
            oldState = TableState.valueOf(new String(oldData));
View Full Code Here

          + Constants.ZTABLE_FLUSH_ID;
     
      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
      byte fid[];
      try {
        fid = zoo.mutate(zTablePath, null, null, new Mutator() {
          @Override
          public byte[] mutate(byte[] currentValue) throws Exception {
            long flushID = Long.parseLong(new String(currentValue, Constants.UTF8));
            flushID++;
            return Long.toString(flushID).getBytes(Constants.UTF8);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.fate.zookeeper.ZooReaderWriter.Mutator

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.