public long decrement(KT key, long l) { return increment(key, -1 * l); }
private void addToQueue(HostAndPort server, KeyExtent extent, Map<String,MapFileInfo> thriftImports) { if (!thriftImports.isEmpty()) { loadMsgs.increment(server, 1); Map<String,MapFileInfo> prev = loadQueue.computeIfAbsent(server, k -> new HashMap<>()) .putIfAbsent(extent.toThrift(), thriftImports); Preconditions.checkState(prev == null, "Unexpectedly saw extent %s twice", extent); // keep a very rough estimate of how much is memory so we can send if over a few megs is // buffered queuedDataSize += thriftImports.keySet().stream().mapToInt(String::length).sum() + server.getHost().length() + 4 + thriftImports.size() * 32; } }
Pair<Long,Map<FileRef,DataFileValue>> reserveFilesForScan() { synchronized (tablet) { while (reservationsBlocked) { try { tablet.wait(50); } catch (InterruptedException e) { log.warn("{}", e.getMessage(), e); } } Set<FileRef> absFilePaths = new HashSet<>(datafileSizes.keySet()); long rid = nextScanReservationId++; scanFileReservations.put(rid, absFilePaths); Map<FileRef,DataFileValue> ret = new HashMap<>(); for (FileRef path : absFilePaths) { fileScanReferenceCounts.increment(path, 1); ret.put(path, datafileSizes.get(path)); } return new Pair<>(rid, ret); } }
stateCounts.increment(srs, 1);
us.successfulCommits.increment(us.currentTablet, us.queuedMutations.get(us.currentTablet).size());
@Override void load(List<TabletMetadata> tablets, Files files) throws MutationsRejectedException { byte[] fam = TextUtil.getBytes(DataFileColumnFamily.NAME); for (TabletMetadata tablet : tablets) { if (tablet.getLocation() != null) { unloadingTablets.increment(tablet.getLocation().getHostAndPort(), 1L); continue; } Mutation mutation = new Mutation(tablet.getExtent().getMetadataEntry()); for (final Bulk.FileInfo fileInfo : files) { String fullPath = new Path(bulkDir, fileInfo.getFileName()).toString(); byte[] val = new DataFileValue(fileInfo.getEstFileSize(), fileInfo.getEstNumEntries()) .encode(); mutation.put(fam, fullPath.getBytes(UTF_8), val); } bw.addMutation(mutation); } }
groupCounts.increment(group, 1); TserverGroupInfo tgi = tservers.get(loc.getTserverInstance()); tgi.addGroup(group);
public long decrement(KT key, long l) { return increment(key, -1 * l); }
tabletsToWaitFor++; if (tablet.hasCurrent()) { serversToFlush.increment(new TServerInstance(tablet.getLocation()), 1);
Pair<Long,Map<FileRef,DataFileValue>> reserveFilesForScan() { synchronized (tablet) { while (reservationsBlocked) { try { tablet.wait(50); } catch (InterruptedException e) { log.warn(e, e); } } Set<FileRef> absFilePaths = new HashSet<>(datafileSizes.keySet()); long rid = nextScanReservationId++; scanFileReservations.put(rid, absFilePaths); Map<FileRef,DataFileValue> ret = new HashMap<>(); for (FileRef path : absFilePaths) { fileScanReferenceCounts.increment(path, 1); ret.put(path, datafileSizes.get(path)); } return new Pair<>(rid, ret); } }
serverCounts.increment(loc.getId(), 1);
stateCounts.increment(srs, 1);
us.successfulCommits.increment(us.currentTablet, us.queuedMutations.get(us.currentTablet).size());
groupCounts.increment(group, 1); TserverGroupInfo tgi = tservers.get(loc.getTserverInstance()); tgi.addGroup(group);
tabletsToWaitFor++; if (server != null) serversToFlush.increment(server, 1);