.map(tm -> tm.getLocation().getHostAndPort().toString()) // convert to host:port strings .map(tm -> tm.getLast().getHostAndPort().toString()) // convert to host:port strings
break; case LastLocationColumnFamily.STR_NAME: te.last = new Location(val, qual, LocationType.LAST); break; case ScanFileColumnFamily.STR_NAME:
@Override void load(List<TabletMetadata> tablets, Files files) { for (TabletMetadata tablet : tablets) { // send files to tablet sever // ideally there should only be one tablet location to send all the files TabletMetadata.Location location = tablet.getLocation(); HostAndPort server = null; if (location == null) { locationLess++; continue; } else { server = location.getHostAndPort(); } Set<String> loadedFiles = tablet.getLoaded(); Map<String,MapFileInfo> thriftImports = new HashMap<>(); for (final Bulk.FileInfo fileInfo : files) { String fullPath = new Path(bulkDir, fileInfo.getFileName()).toString(); if (!loadedFiles.contains(fullPath)) { thriftImports.put(fileInfo.getFileName(), new MapFileInfo(fileInfo.getEstFileSize())); } } addToQueue(server, tablet.getExtent(), thriftImports); } sendQueued(4 * 1024 * 1024); }
@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); } }
public TServerInstance(Location location) { this(location.getHostAndPort(), location.getSession()); }
public boolean hasCurrent() { ensureFetched(FetchedColumns.LOCATION); return location != null && location.getType() == LocationType.CURRENT; }
private void setLocationOnce(String val, String qual, LocationType lt) { if (location != null) throw new IllegalStateException("Attempted to set second location for tableId: " + tableId + " endrow: " + endRow + " -- " + location + " " + qual + " " + val); location = new Location(val, qual, lt); }