public void update(String type) { this.lock.readLock().lock(); try { this.counts.get(type).increment(); } finally { this.lock.readLock().unlock(); } }
public void incrementStreamThroughput(String streamId) { final ConcurrentHashMap<String, Counter> counterMap = streamThroughput.get(); counterMap.putIfAbsent(streamId, new Counter()); counterMap.get(streamId).increment(); }
/** * Return an iterator that scans over the EntityGroup, returning the indicated * columns and rows specified by the * * <p> * This Iterator must be closed by the caller. * * @param action * @return * @throws java.io.IOException * @throws com.alibaba.wasp.storage.StorageTableNotFoundException */ public EntityGroupScanner getScanner(ScanAction action) throws IOException, StorageTableNotFoundException { startEntityGroupOperation(); readRequestsCount.increment(); try { return instantiateEntityGroupScanner(action); } finally { closeEntityGroupOperation(); } }
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics( this.writeRequestsCount.get());
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics( this.writeRequestsCount.get()); try {
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); try {
protected RegionScanner getScanner(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException { startRegionOperation(); this.readRequestsCount.increment(); this.opMetrics.setReadRequestCountMetrics(this.readRequestsCount.get()); try { // Verify families are all valid prepareScanner(scan); if(scan.hasFamilies()) { for(byte [] family : scan.getFamilyMap().keySet()) { checkFamily(family); } } return instantiateRegionScanner(scan, additionalScanners); } finally { closeRegionOperation(); } }
@Override public synchronized boolean next(List<KeyValue> outResults, int limit, String metric) throws IOException { if (this.filterClosed) { throw new UnknownScannerException("Scanner was closed (timed out?) " + "after we renewed it. Could be caused by a very slow scanner " + "or a lengthy garbage collection"); } startRegionOperation(); readRequestsCount.increment(); opMetrics.setReadRequestCountMetrics(readRequestsCount.get()); try { // This could be a new thread from the last time we called next(). MultiVersionConsistencyControl.setThreadReadPoint(this.readPt); return nextRaw(outResults, limit, metric); } finally { closeRegionOperation(); } }
writeRequestsCount.increment(); try { internalObtainRowLock(action.getCombinedPrimaryKey());
throws NotServingEntityGroupException, IOException { startEntityGroupOperation(); writeRequestsCount.increment(); try { internalObtainRowLock(action.getCombinedPrimaryKey());
throws NotServingEntityGroupException, IOException { startEntityGroupOperation(); writeRequestsCount.increment(); try { if (StringUtils.isNullOrEmpty(action.getSessionId())) {
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); try {
public OperationStatus transaction(TransactionAction transactionAction) throws IOException { startEntityGroupOperation(); writeRequestsCount.increment(); try { Transaction transaction = new Transaction(currentReadTimeStamp());
this.readRequestsCount.increment(); this.opMetrics.setReadRequestCountMetrics(this.readRequestsCount.get()); try {
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); try {
/** * @param delete delete object * @param lockid existing lock id, or null for grab a lock * @param writeToWAL append to the write ahead lock or not * @throws IOException read exceptions * @deprecated row locks (lockId) held outside the extent of the operation are deprecated. */ public void delete(Delete delete, Integer lockid, boolean writeToWAL) throws IOException { checkReadOnly(); checkResources(); Integer lid = null; startRegionOperation(); this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); try { byte [] row = delete.getRow(); // If we did not pass an existing row lock, obtain a new one lid = getLock(lockid, row, true); try { // All edits for the given row (across all column families) must happen atomically. prepareDelete(delete); internalDelete(delete, delete.getClusterId(), writeToWAL); } finally { if(lockid == null) releaseRowLock(lid); } } finally { closeRegionOperation(); } }
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); try {
selectSQLCount.increment(); DQLPlan dqlPlan = (DQLPlan) executePlan; dqlPlan.setFetchRows(fetchSize); } else if (executePlan instanceof DMLPlan) { if (executePlan instanceof InsertPlan) { insertSQLCount.increment(); List<WriteResultProto> writeResults = executeEngine .execInsertPlan((InsertPlan) executePlan); return ResponseConverter.buildExecuteResponse(writeResults); } else if (executePlan instanceof UpdatePlan) { updateSQLCount.increment(); List<WriteResultProto> writeResults = executeEngine .execUpdatePlan((UpdatePlan) executePlan); return ResponseConverter.buildExecuteResponse(writeResults); } else if (executePlan instanceof DeletePlan) { deleteSQLCount.increment(); List<WriteResultProto> writeResults = executeEngine .execDeletePlan((DeletePlan) executePlan);
this.writeRequestsCount.increment(); this.opMetrics.setWriteRequestCountMetrics(this.writeRequestsCount.get()); doPreMutationHook(batchOp);
/** * No-index query using primary key. * * @param action * @return * @throws java.io.IOException * @throws com.alibaba.wasp.storage.StorageTableNotFoundException */ public Result get(GetAction action) throws IOException, StorageTableNotFoundException { Get get = new Get(RowBuilder.build().buildEntityRowKey(this.conf, action.getFTableName(), action.getCombinedPrimaryKey())); get.setMaxVersions(1); // as a result of the maximum timestamp value is exclusive, but we need the // inclusive one . so plus one to timestamp if (action.isForUpdate()) { this.internalObtainRowLock(action.getCombinedPrimaryKey(), action.getSessionId()); } else { if (action.getReaderMode() == ReadModel.CURRENT) { this.internalObtainRowLock(action.getCombinedPrimaryKey()); this.releaseRowLock(action.getCombinedPrimaryKey()); } } readRequestsCount.increment(); get.setTimeRange(0, timestamp(action.getReaderMode()) + 1); return storageServices.getRow( StorageTableNameBuilder.buildEntityTableName(action.getFTableName()), get); }