/** * Adds the mutations to labels region and set the results to the finalOpStatus. finalOpStatus * might have some entries in it where the OpStatus is FAILURE. We will leave those and set in * others in the order. * @param mutations * @param finalOpStatus * @return whether we need a ZK update or not. */ private boolean mutateLabelsRegion(List<Mutation> mutations, OperationStatus[] finalOpStatus) throws IOException { OperationStatus[] opStatus = this.labelsRegion.batchMutate(mutations .toArray(new Mutation[mutations.size()])); int i = 0; boolean updateZk = false; for (OperationStatus status : opStatus) { // Update the zk when atleast one of the mutation was added successfully. updateZk = updateZk || (status.getOperationStatusCode() == OperationStatusCode.SUCCESS); for (; i < finalOpStatus.length; i++) { if (finalOpStatus[i] == null) { finalOpStatus[i] = status; break; } } } return updateZk; }
@Override public void doWork() throws Exception { Put[] puts = new Put[1]; Put put = new Put(Bytes.toBytes("r1")); put.addColumn(Bytes.toBytes(family), Bytes.toBytes("q1"), Bytes.toBytes("50")); puts[0] = put; testStep = TestStep.PUT_STARTED; region.batchMutate(puts); } }
deleteArr[i++] = createDeleteMutation(deleteRow, deleteType, timestamp); OperationStatus[] opStatus = region.batchMutate(deleteArr); for (i = 0; i < opStatus.length; i++) { if (opStatus[i].getOperationStatusCode() != OperationStatusCode.SUCCESS) {
public static void writeLocalUpdates(Region region, final List<Mutation> mutations, boolean skipWAL) throws IOException { if(skipWAL) { for (Mutation m : mutations) { m.setDurability(Durability.SKIP_WAL); } } region.batchMutate(mutations.toArray(new Mutation[mutations.size()])); }
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException { if (mutations.isEmpty()) { return; } Mutation[] mutationArray = new Mutation[mutations.size()]; // When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the // flush happen which decrease the memstore size and then writes allowed on the region. for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize && i < 30; i++) { try { checkForRegionClosing(); Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException(e); } } // TODO: should we use the one that is all or none? logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString()); region.batchMutate(mutations.toArray(mutationArray)); }
@Override public boolean next(List<Cell> results) throws IOException { List<Cell> dataTableResults = new ArrayList<Cell>(); boolean next = super.next(dataTableResults); addMutations(dataTableResults); if (ServerUtil.readyToCommit(mutationList.size(), mutationList.byteSize(), maxBatchSize, maxBatchSizeBytes)||!next) { region.batchMutate(mutationList.toArray(new Mutation[mutationList.size()])); mutationList.clear(); } return next; }
Region region = e.getEnvironment().getRegion(); region.batchMutate(mutations.toArray(new Mutation[0]));
region.batchMutate(mutations); long serverTimestamp = MetaDataUtil.getClientTimeStamp(m);
public static void writeLocalUpdates(Region region, final List<Mutation> mutations, boolean skipWAL) throws IOException { if(skipWAL) { for (Mutation m : mutations) { m.setDurability(Durability.SKIP_WAL); } } region.batchMutate(mutations.toArray(new Mutation[mutations.size()])); }
public static void writeLocalUpdates(Region region, final List<Mutation> mutations, boolean skipWAL) throws IOException { if(skipWAL) { for (Mutation m : mutations) { m.setDurability(Durability.SKIP_WAL); } } region.batchMutate(mutations.toArray(new Mutation[mutations.size()])); }
/** * Adds the mutations to labels region and set the results to the finalOpStatus. finalOpStatus * might have some entries in it where the OpStatus is FAILURE. We will leave those and set in * others in the order. * @param mutations * @param finalOpStatus * @return whether we need a ZK update or not. */ private boolean mutateLabelsRegion(List<Mutation> mutations, OperationStatus[] finalOpStatus) throws IOException { OperationStatus[] opStatus = this.labelsRegion.batchMutate(mutations .toArray(new Mutation[mutations.size()]), HConstants.NO_NONCE, HConstants.NO_NONCE); int i = 0; boolean updateZk = false; for (OperationStatus status : opStatus) { // Update the zk when atleast one of the mutation was added successfully. updateZk = updateZk || (status.getOperationStatusCode() == OperationStatusCode.SUCCESS); for (; i < finalOpStatus.length; i++) { if (finalOpStatus[i] == null) { finalOpStatus[i] = status; break; } } } return updateZk; }
region.batchMutate(mutations);
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException { if (mutations.isEmpty()) { return; } Mutation[] mutationArray = new Mutation[mutations.size()]; // When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the // flush happen which decrease the memstore size and then writes allowed on the region. for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize && i < 30; i++) { try { checkForRegionClosing(); Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException(e); } } // TODO: should we use the one that is all or none? logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString()); region.batchMutate(mutations.toArray(mutationArray)); }
private void commitBatch(Region region, List<Mutation> mutations, long blockingMemstoreSize) throws IOException { if (mutations.isEmpty()) { return; } Mutation[] mutationArray = new Mutation[mutations.size()]; // When memstore size reaches blockingMemstoreSize we are waiting 3 seconds for the // flush happen which decrease the memstore size and then writes allowed on the region. for (int i = 0; blockingMemstoreSize > 0 && (region.getMemStoreHeapSize() + region.getMemStoreOffHeapSize()) > blockingMemstoreSize && i < 30; i++) { try { checkForRegionClosing(); Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException(e); } } // TODO: should we use the one that is all or none? logger.debug("Committing batch of " + mutations.size() + " mutations for " + region.getRegionInfo().getTable().getNameAsString()); region.batchMutate(mutations.toArray(mutationArray)); }
@Override public void doWork() throws Exception { Put[] puts = new Put[1]; Put put = new Put(Bytes.toBytes("r1")); put.addColumn(Bytes.toBytes(family), Bytes.toBytes("q1"), Bytes.toBytes("50")); puts[0] = put; testStep = TestStep.PUT_STARTED; region.batchMutate(puts); } }
@Override public boolean next(List<Cell> results) throws IOException { List<Cell> dataTableResults = new ArrayList<Cell>(); boolean next = super.next(dataTableResults); addMutations(dataTableResults); if (ServerUtil.readyToCommit(mutationList.size(), mutationList.byteSize(), maxBatchSize, maxBatchSizeBytes)||!next) { region.batchMutate(mutationList.toArray(new Mutation[mutationList.size()])); mutationList.clear(); } return next; }
@Override public boolean next(List<Cell> results) throws IOException { List<Cell> dataTableResults = new ArrayList<Cell>(); boolean next = super.next(dataTableResults); addMutations(dataTableResults); if (ServerUtil.readyToCommit(mutationList.size(), mutationList.byteSize(), maxBatchSize, maxBatchSizeBytes)||!next) { region.batchMutate(mutationList.toArray(new Mutation[mutationList.size()])); mutationList.clear(); } return next; }
Region region = e.getEnvironment().getRegion(); region.batchMutate(mutations.toArray(new Mutation[0]));
Region region = e.getEnvironment().getRegion(); region.batchMutate(mutations.toArray(new Mutation[0]));
OperationStatus[] codes = region.batchMutate(mArray, HConstants.NO_NONCE, HConstants.NO_NONCE); for (i = 0; i < codes.length; i++) {