Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Mutation


    }
  }
 
  public static void updateTabletFlushID(KeyExtent extent, long flushID, TCredentials credentials, ZooLock zooLock) {
    if (!extent.isRootTablet()) {
      Mutation m = new Mutation(extent.getMetadataEntry());
      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(Long.toString(flushID).getBytes(Constants.UTF8)));
      update(credentials, zooLock, m);
    }
  }
View Full Code Here


    }
  }
 
  public static void updateTabletCompactID(KeyExtent extent, long compactID, TCredentials credentials, ZooLock zooLock) {
    if (!extent.isRootTablet()) {
      Mutation m = new Mutation(extent.getMetadataEntry());
      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(Long.toString(compactID).getBytes(Constants.UTF8)));
      update(credentials, zooLock, m);
    }
  }
View Full Code Here

      update(credentials, zooLock, m);
    }
  }
 
  public static void updateTabletDataFile(long tid, KeyExtent extent, Map<String,DataFileValue> estSizes, String time, TCredentials credentials, ZooLock zooLock) {
    Mutation m = new Mutation(extent.getMetadataEntry());
    byte[] tidBytes = Long.toString(tid).getBytes(Constants.UTF8);
   
    for (Entry<String,DataFileValue> entry : estSizes.entrySet()) {
      Text file = new Text(entry.getKey());
      m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, file, new Value(entry.getValue().encode()));
      m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, file, new Value(tidBytes));
    }
    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(Constants.UTF8)));
    update(credentials, zooLock, m);
  }
View Full Code Here

    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(Constants.UTF8)));
    update(credentials, zooLock, m);
  }
 
  public static void addTablet(KeyExtent extent, String path, TCredentials credentials, char timeType, ZooLock lock) {
    Mutation m = extent.getPrevRowUpdateMutation();
   
    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes(Constants.UTF8)));
    Constants.METADATA_TIME_COLUMN.put(m, new Value((timeType + "0").getBytes(Constants.UTF8)));
   
    update(credentials, lock, m);
View Full Code Here

   
    update(credentials, lock, m);
  }
 
  public static void updateTabletPrevEndRow(KeyExtent extent, TCredentials credentials) {
    Mutation m = extent.getPrevRowUpdateMutation(); //
    update(credentials, m);
  }
View Full Code Here

    return sizes;
  }

  public static void addNewTablet(KeyExtent extent, String path, TServerInstance location, Map<String,DataFileValue> datafileSizes,
      Map<String,Long> bulkLoadedFiles, TCredentials credentials, String time, long lastFlushID, long lastCompactID, ZooLock zooLock) {
    Mutation m = extent.getPrevRowUpdateMutation();
   
    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes(Constants.UTF8)));
    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(Constants.UTF8)));
    if (lastFlushID > 0)
      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(Long.toString(lastFlushID).getBytes(Constants.UTF8)));
    if (lastCompactID > 0)
      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(Long.toString(lastCompactID).getBytes(Constants.UTF8)));
   
    if (location != null) {
      m.put(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, location.asColumnQualifier(), location.asMutationValue());
      m.putDelete(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY, location.asColumnQualifier());
    }

    for (Entry<String,DataFileValue> entry : datafileSizes.entrySet()) {
      m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(entry.getValue().encode()));
    }

    for (Entry<String,Long> entry : bulkLoadedFiles.entrySet()) {
      byte[] tidBytes = Long.toString(entry.getValue()).getBytes(Constants.UTF8);
      m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(tidBytes));
    }
   
    update(credentials, zooLock, m);
  }
View Full Code Here

    update(credentials, zooLock, m);
  }
 
  public static void rollBackSplit(Text metadataEntry, Text oldPrevEndRow, TCredentials credentials, ZooLock zooLock) {
    KeyExtent ke = new KeyExtent(metadataEntry, oldPrevEndRow);
    Mutation m = ke.getPrevRowUpdateMutation();
    Constants.METADATA_SPLIT_RATIO_COLUMN.putDelete(m);
    Constants.METADATA_OLD_PREV_ROW_COLUMN.putDelete(m);
    update(credentials, zooLock, m);
  }
View Full Code Here

    Constants.METADATA_OLD_PREV_ROW_COLUMN.putDelete(m);
    update(credentials, zooLock, m);
  }

  public static void splitTablet(KeyExtent extent, Text oldPrevEndRow, double splitRatio, TCredentials credentials, ZooLock zooLock) {
    Mutation m = extent.getPrevRowUpdateMutation(); //
   
    Constants.METADATA_SPLIT_RATIO_COLUMN.put(m, new Value(Double.toString(splitRatio).getBytes(Constants.UTF8)));
   
    Constants.METADATA_OLD_PREV_ROW_COLUMN.put(m, KeyExtent.encodePrevEndRow(oldPrevEndRow));
    Constants.METADATA_CHOPPED_COLUMN.putDelete(m);
View Full Code Here

    update(credentials, zooLock, m);
  }
 
  public static void finishSplit(Text metadataEntry, Map<String,DataFileValue> datafileSizes, List<String> highDatafilesToRemove, TCredentials credentials,
      ZooLock zooLock) {
    Mutation m = new Mutation(metadataEntry);
    Constants.METADATA_SPLIT_RATIO_COLUMN.putDelete(m);
    Constants.METADATA_OLD_PREV_ROW_COLUMN.putDelete(m);
    Constants.METADATA_CHOPPED_COLUMN.putDelete(m);
   
    for (Entry<String,DataFileValue> entry : datafileSizes.entrySet()) {
      m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(entry.getValue().encode()));
    }

    for (String pathToRemove : highDatafilesToRemove) {
      m.putDelete(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(pathToRemove));
    }

    update(credentials, zooLock, m);
  }
View Full Code Here

      // add delete flags for those paths before the data file reference is removed
      addDeleteEntries(extent, datafilesToDelete, credentials);
    }

    // replace data file references to old mapfiles with the new mapfiles
    Mutation m = new Mutation(extent.getMetadataEntry());

    for (String pathToRemove : datafilesToDelete)
      m.putDelete(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(pathToRemove));

    for (String scanFile : scanFiles)
      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value(new byte[0]));
   
    if (size.getNumEntries() > 0)
      m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(path), new Value(size.encode()));

    if (compactionId != null)
      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(Long.toString(compactionId).getBytes(Constants.UTF8)));
   
    TServerInstance self = getTServerInstance(address, zooLock);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.Mutation

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.