public void clearFutureLocation(Mutation m) { m.putDelete(TabletsSection.FutureLocationColumnFamily.NAME, asColumnQualifier()); }
public void clearLocation(Mutation m) { m.putDelete(TabletsSection.CurrentLocationColumnFamily.NAME, asColumnQualifier()); }
public void clearLastLocation(Mutation m) { m.putDelete(TabletsSection.LastLocationColumnFamily.NAME, asColumnQualifier()); }
public void putFutureLocation(Mutation m) { m.put(TabletsSection.FutureLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void putLastLocation(Mutation m) { m.put(TabletsSection.LastLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void putLocation(Mutation m) { m.put(TabletsSection.CurrentLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void clearLastLocation(Mutation m) { m.putDelete(TabletsSection.LastLocationColumnFamily.NAME, asColumnQualifier()); }
public void clearLastLocation(Mutation m) { m.putDelete(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY, asColumnQualifier()); }
public void clearLocation(Mutation m) { m.putDelete(TabletsSection.CurrentLocationColumnFamily.NAME, asColumnQualifier()); }
public void clearFutureLocation(Mutation m) { m.putDelete(TabletsSection.FutureLocationColumnFamily.NAME, asColumnQualifier()); }
public void putLocation(Mutation m) { m.put(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, asColumnQualifier(), asMutationValue()); }
public void putLocation(Mutation m) { m.put(TabletsSection.CurrentLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void putFutureLocation(Mutation m) { m.put(TabletsSection.FutureLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void putLastLocation(Mutation m) { m.put(TabletsSection.LastLocationColumnFamily.NAME, asColumnQualifier(), asMutationValue()); }
public void putFutureLocation(Mutation m) { m.put(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY, asColumnQualifier(), asMutationValue()); }
public void putLastLocation(Mutation m) { m.put(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY, asColumnQualifier(), asMutationValue()); }
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(UTF_8))); Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(UTF_8))); if (lastFlushID > 0) Constants.METADATA_FLUSH_COLUMN.put(m, new Value(Long.toString(lastFlushID).getBytes(UTF_8))); if (lastCompactID > 0) Constants.METADATA_COMPACT_COLUMN.put(m, new Value(Long.toString(lastCompactID).getBytes(UTF_8))); 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(UTF_8); m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(tidBytes)); } update(credentials, zooLock, m); }
@Override public void unassign(Collection<TabletLocationState> tablets) throws DistributedStoreException { BatchWriter writer = createBatchWriter(); try { for (TabletLocationState tls : tablets) { Mutation m = new Mutation(tls.extent.getMetadataEntry()); if (tls.current != null) { m.putDelete(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, tls.current.asColumnQualifier()); } if (tls.future != null) { m.putDelete(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY, tls.future.asColumnQualifier()); } writer.addMutation(m); } } catch (Exception ex) { throw new DistributedStoreException(ex); } finally { try { writer.close(); } catch (MutationsRejectedException e) { throw new DistributedStoreException(e); } } }
@Override public void setFutureLocations(Collection<Assignment> assignments) throws DistributedStoreException { BatchWriter writer = createBatchWriter(); try { for (Assignment assignment : assignments) { Mutation m = new Mutation(assignment.tablet.getMetadataEntry()); m.put(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY, assignment.server.asColumnQualifier(), assignment.server.asMutationValue()); writer.addMutation(m); } } catch (Exception ex) { throw new DistributedStoreException(ex); } finally { try { writer.close(); } catch (MutationsRejectedException e) { throw new DistributedStoreException(e); } } }
@Override public void setLocations(Collection<Assignment> assignments) throws DistributedStoreException { BatchWriter writer = createBatchWriter(); try { for (Assignment assignment : assignments) { Mutation m = new Mutation(assignment.tablet.getMetadataEntry()); Text cq = assignment.server.asColumnQualifier(); m.put(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, cq, assignment.server.asMutationValue()); m.putDelete(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY, cq); writer.addMutation(m); } } catch (Exception ex) { throw new DistributedStoreException(ex); } finally { try { writer.close(); } catch (MutationsRejectedException e) { throw new DistributedStoreException(e); } } }