method2testcases
stringlengths
118
6.63k
### Question: UpdateParametersRoutine { public void updateParameters(@NonNull UpdateRequest request) { Capabilities capabilities = cameraDevice.getCapabilities(); cameraDevice.updateParameters( combineParameters(asList( flashModeParameters(request, capabilities), focusModeParameters(request, capabilities) )) ); } Updat...
### Question: FotoapparatBuilder { public Fotoapparat build() { validate(); return Fotoapparat.create(this); } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSize(@NonNull SelectorFunction<Collection<Size>, Size> selector)...
### Question: FotoapparatBuilder { public FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider) { this.cameraProvider = cameraProvider; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSize...
### Question: FotoapparatBuilder { public FotoapparatBuilder logger(@NonNull Logger logger) { this.logger = logger; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSize(@NonNull SelectorFunction<Collection<Si...
### Question: FotoapparatBuilder { public FotoapparatBuilder focusMode(@NonNull SelectorFunction<Collection<FocusMode>, FocusMode> selector) { focusModeSelector = selector; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); Fotoapparat...
### Question: FotoapparatBuilder { public FotoapparatBuilder previewFpsRange(@NonNull SelectorFunction<Collection<Range<Integer>>, Range<Integer>> selector) { previewFpsRangeSelector = selector; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider camera...
### Question: FotoapparatBuilder { public FotoapparatBuilder flash(@NonNull SelectorFunction<Collection<Flash>, Flash> selector) { flashSelector = selector; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSiz...
### Question: FotoapparatBuilder { public FotoapparatBuilder frameProcessor(@NonNull FrameProcessor frameProcessor) { this.frameProcessor = frameProcessor; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSize...
### Question: FotoapparatBuilder { public FotoapparatBuilder photoSize(@NonNull SelectorFunction<Collection<Size>, Size> selector) { photoSizeSelector = selector; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder ph...
### Question: FotoapparatBuilder { public FotoapparatBuilder previewSize(@NonNull SelectorFunction<Collection<Size>, Size> selector) { previewSizeSelector = selector; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilde...
### Question: PhotoResult { public PendingResult<Photo> toPendingResult() { return pendingResult; } PhotoResult(PendingResult<Photo> pendingResult); static PhotoResult fromFuture(Future<Photo> photoFuture); PendingResult<BitmapPhoto> toBitmap(); PendingResult<BitmapPhoto> toBitmap(Transformer<Size, Size> sizeTransforme...
### Question: FotoapparatBuilder { public FotoapparatBuilder previewScaleType(ScaleType scaleType) { this.scaleType = scaleType; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoSize(@NonNull SelectorFunction<...
### Question: FotoapparatBuilder { public FotoapparatBuilder cameraErrorCallback(@NonNull CameraErrorCallback callback) { this.cameraErrorCallback = callback; return this; } FotoapparatBuilder(@NonNull Context context); FotoapparatBuilder cameraProvider(@NonNull CameraProvider cameraProvider); FotoapparatBuilder photoS...
### Question: DefaultProvider implements CameraProvider { @Override public CameraDevice get(Logger logger) { return sdkInfo.isBellowLollipop() ? v1Provider.get(logger) : v2Provider.get(logger); } DefaultProvider(CameraProvider v1Provider, CameraProvider v2Provider); DefaultProvider(CameraProvider v1Provider,...
### Question: GetCharacteristicsTask { public Characteristics execute(String cameraId) { try { return new Characteristics( manager.getCameraCharacteristics(cameraId) ); } catch (CameraAccessException e) { throw new CameraException(e); } } GetCharacteristicsTask(CameraManager manager); Characteristics execute(String cam...
### Question: SetTextureBufferSizeTask implements Runnable { @Override public void run() { surfaceTexture.setDefaultBufferSize(previewSize.width, previewSize.height); } SetTextureBufferSizeTask(SurfaceTexture surfaceTexture, Size previewSize); @Override void run(); }### Answer: @Test public void setBufferSize() throws...
### Question: Camera2 implements CameraDevice { @Override public void open(LensPosition lensPosition) { recordMethod(); connectionOperator.open(lensPosition); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, Surface...
### Question: Camera2 implements CameraDevice { @Override public void close() { recordMethod(); connectionOperator.close(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfaceOperator, ...
### Question: Camera2 implements CameraDevice { @Override public void startPreview() { recordMethod(); previewOperator.startPreview(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfaceOperator...
### Question: PhotoResult { public PendingResult<BitmapPhoto> toBitmap() { return toBitmap(originalSize()); } PhotoResult(PendingResult<Photo> pendingResult); static PhotoResult fromFuture(Future<Photo> photoFuture); PendingResult<BitmapPhoto> toBitmap(); PendingResult<BitmapPhoto> toBitmap(Transformer<Size, Size> size...
### Question: Camera2 implements CameraDevice { @Override public void stopPreview() { recordMethod(); previewOperator.stopPreview(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfaceOperator, ...
### Question: Camera2 implements CameraDevice { @Override public void setDisplaySurface(Object displaySurface) { recordMethod(); surfaceOperator.setDisplaySurface(displaySurface); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, ...
### Question: Camera2 implements CameraDevice { @Override public void setDisplayOrientation(int degrees) { recordMethod(); orientationOperator.setDisplayOrientation(degrees); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, ...
### Question: Camera2 implements CameraDevice { @Override public void updateParameters(Parameters parameters) { recordMethod(); parametersOperator.updateParameters(parameters); currentParameters = parameters; currentParametersLatch.countDown(); } Camera2(Logger logger, ConnectionOperator connectionOp...
### Question: Camera2 implements CameraDevice { @Override public Capabilities getCapabilities() { recordMethod(); return capabilitiesOperator.getCapabilities(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, Surfa...
### Question: Camera2 implements CameraDevice { @Override public Photo takePicture() { recordMethod(); return captureOperator.takePicture(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfaceOp...
### Question: Camera2 implements CameraDevice { @Override public PreviewStream getPreviewStream() { recordMethod(); return previewStream; } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfaceOpera...
### Question: Camera2 implements CameraDevice { @Override public FocusResult autoFocus() { recordMethod(); return autoFocusOperator.autoFocus(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperator surfa...
### Question: Camera2 implements CameraDevice { @Override public void measureExposure() { recordMethod(); exposureMeasurementOperator.measureExposure(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, SurfaceOperat...
### Question: Camera2 implements CameraDevice { @Override public RendererParameters getRendererParameters() { recordMethod(); return rendererParametersOperator.getRendererParameters(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previewOperator, ...
### Question: PhotoResult { public PendingResult<Void> saveToFile(File file) { return pendingResult .transform(SaveToFileTransformer.create(file)); } PhotoResult(PendingResult<Photo> pendingResult); static PhotoResult fromFuture(Future<Photo> photoFuture); PendingResult<BitmapPhoto> toBitmap(); PendingResult<BitmapPhot...
### Question: Camera2 implements CameraDevice { @Override public List<LensPosition> getAvailableLensPositions() { recordMethod(); return availableLensPositionsProvider.getAvailableLensPositions(); } Camera2(Logger logger, ConnectionOperator connectionOperator, PreviewOperator previ...
### Question: CapabilitiesFactory implements CapabilitiesOperator { @Override public Capabilities getCapabilities() { return new Capabilities( availableJpegSizes(), availablePreviewSizes(), availableFocusModes(), availableFlashModes(), availablePreviewFpsRanges(), availableSensorSensitivity(), false ); } CapabilitiesFa...
### Question: Characteristics { public boolean isFrontFacingLens() { return cameraCharacteristics.get(CameraCharacteristics.LENS_FACING) == CameraMetadata.LENS_FACING_FRONT; } Characteristics(CameraCharacteristics cameraCharacteristics); boolean isFrontFacingLens(); boolean isFlashAvailable(); boolean isFixedFocusLens(...
### Question: Characteristics { public boolean isFlashAvailable() { return cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE); } Characteristics(CameraCharacteristics cameraCharacteristics); boolean isFrontFacingLens(); boolean isFlashAvailable(); boolean isFixedFocusLens(); boolean isLegacyDevice();...
### Question: Characteristics { public boolean isFixedFocusLens() { Float focusDistance = cameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE); return focusDistance == 0f; } Characteristics(CameraCharacteristics cameraCharacteristics); boolean isFrontFacingLens(); boolean isFlashAvailable()...
### Question: CapabilitiesResult { public PendingResult<Capabilities> toPendingResult() { return pendingResult; } CapabilitiesResult(PendingResult<Capabilities> pendingResult); static CapabilitiesResult fromFuture(Future<Capabilities> capabilitiesFuture); PendingResult<Capabilities> toPendingResult(); }### Answer: @Te...
### Question: LoggingCallAdapterFactory extends CallAdapter.Factory { public static String errorMessage(ResponseBody errorBody) throws IOException { if (errorBody.contentLength() == 0) { return ""; } Buffer buffer = new Buffer(); buffer.writeAll(errorBody.source().peek()); if (!isPlaintext(buffer)) { return "Error body...
### Question: HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } HRegion...
### Question: HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public static void configureIncrementalLoad(Job job, HTable table) throws IOException { Configuration conf = job.getConfiguration(); Class<? extends Partitioner> topClass; try { topClass = getTotalOrderPartitionerClass(); } cat...
### Question: HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { static Map<byte[], String> createFamilyCompressionMap(Configuration conf) { return createFamilyConfValueMap(conf, COMPRESSION_CONF_KEY); } RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext...
### Question: Get extends OperationWithAttributes implements Writable, Row, Comparable<Row> { public Get() {} Get(); Get(byte [] row); Get(byte [] row, RowLock rowLock); Get addFamily(byte [] family); Get addColumn(byte [] family, byte [] qualifier); Get setTimeRange(long minStamp, long maxStamp); Get setTimeStamp(lo...
### Question: HTableUtil { public static void bucketRsPut(HTable htable, List<Put> puts) throws IOException { Map<String, List<Put>> putMap = createRsPutMap(htable, puts); for (List<Put> rsPuts: putMap.values()) { htable.put( rsPuts ); } htable.flushCommits(); } static void bucketRsPut(HTable htable, List<Put> puts); ...
### Question: HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } } static...
### Question: Operation { public String toJSON(int maxCols) throws IOException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(toMap(maxCols)); } abstract Map<String, Object> getFingerprint(); abstract Map<String, Object> toMap(int maxCols); Map<String, Object> toMap(); String toJSON(int m...
### Question: MetaScanner { public static void metaScan(Configuration configuration, MetaScannerVisitor visitor) throws IOException { metaScan(configuration, visitor, null); } static void metaScan(Configuration configuration, MetaScannerVisitor visitor); static void metaScan(Configuration configuration, Me...
### Question: ConnectionUtils { public static long getPauseTime(final long pause, final int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) { ntries = HConstants.RETRY_BACKOFF.length - 1; } long normalPause = pause * HConstants.RETRY_BACKOFF[ntries]; long jitter = (long)(normalPause * RANDOM...
### Question: ZooKeeperMainServerArg { public String parse(final Configuration c) { Properties zkProps = ZKConfig.makeZKProps(c); String host = null; String clientPort = null; List<String> hosts = new ArrayList<String>(); for (Entry<Object, Object> entry: zkProps.entrySet()) { String key = entry.getKey().toString().tri...
### Question: ActiveMasterManager extends ZooKeeperListener { boolean blockUntilBecomingActiveMaster(MonitoredTask startupStatus, ClusterStatusTracker clusterStatusTracker) { while (true) { startupStatus.setStatus("Trying to register in ZK as active master"); try { String backupZNode = ZKUtil.joinZNode( this.watcher.ba...
### Question: AssignmentManager extends ZooKeeperListener { void processDeadServersAndRegionsInTransition() throws KeeperException, IOException, InterruptedException { processDeadServersAndRegionsInTransition(null); } AssignmentManager(Server master, ServerManager serverManager, CatalogTracker catalogTracker, fin...
### Question: TableDeleteFamilyHandler extends TableEventHandler { @Override public String toString() { String name = "UnknownServerName"; if(server != null && server.getServerName() != null) { name = server.getServerName().toString(); } String family = "UnknownFamily"; if(familyName != null) { family = Bytes.toString(...
### Question: DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers...
### Question: DefaultLoadBalancer implements LoadBalancer { public Map<ServerName, List<HRegionInfo>> roundRobinAssignment( List<HRegionInfo> regions, List<ServerName> servers) { if (regions.isEmpty() || servers.isEmpty()) { return null; } Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<ServerName,List<HRe...
### Question: CleanerChore extends Chore { public boolean checkAndDeleteDirectory(Path toCheck) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Checking directory: " + toCheck); } FileStatus[] children = FSUtils.listStatus(fs, toCheck, null); if (children == null) { try { return HBaseFileSystem.deleteFileFr...
### Question: SnapshotLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration conf) { super.setConf(conf); try { long cacheRefreshPeriod = conf.getLong( HLOG_CACHE_REFRESH_PERIOD_CONF_KEY, DEFAULT_HLOG_CACHE_REFRESH_PERIOD); final FileSystem fs = FSUtils.getCurrentFileSystem(conf); Path ...
### Question: SplitTransaction { public boolean prepare() { if (!this.parent.isSplittable()) return false; if (this.splitrow == null) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, s...
### Question: SplitTransaction { public boolean rollback(final Server server, final RegionServerServices services) throws IOException { boolean result = true; FileSystem fs = this.parent.getFilesystem(); ListIterator<JournalEntry> iterator = this.journal.listIterator(this.journal.size()); while (iterator.hasPrevious())...
### Question: SchemaMetrics { public static String generateSchemaMetricsPrefix(String tableName, final String cfName) { tableName = getEffectiveTableName(tableName); String schemaMetricPrefix = tableName.equals(TOTAL_KEY) ? "" : TABLE_PREFIX + tableName + "."; schemaMetricPrefix += cfName.equals(TOTAL_KEY) ? "" : CF_PR...
### Question: SchemaConfigured implements HeapSize, SchemaAware { public String schemaConfAsJSON() { return "{\"tableName\":\"" + tableName + "\",\"cfName\":\"" + cfName + "\"}"; } private SchemaConfigured(Configuration conf); SchemaConfigured(); SchemaConfigured(Configuration conf, Path path); SchemaConfigured(Pat...
### Question: SchemaConfigured implements HeapSize, SchemaAware { public void passSchemaMetricsTo(SchemaConfigured target) { if (isNull()) { resetSchemaMetricsConf(target); return; } if (!isSchemaConfigured()) { throw new IllegalStateException("Table name/CF not initialized: " + schemaConfAsJSON()); } if (conflictingWi...
### Question: SchemaConfigured implements HeapSize, SchemaAware { public static void resetSchemaMetricsConf(SchemaConfigured target) { target.tableName = null; target.cfName = null; target.schemaMetrics = null; target.schemaConfigurationChanged(); } private SchemaConfigured(Configuration conf); SchemaConfigured(); S...
### Question: ExecutorService { public ExecutorService(final String servername) { super(); this.servername = servername; } ExecutorService(final String servername); ExecutorType getExecutorServiceType(final EventHandler.EventType type); void shutdown(); void startExecutorService(final ExecutorType type, final int maxTh...
### Question: RegionSplitPolicy extends Configured { public static RegionSplitPolicy create(HRegion region, Configuration conf) throws IOException { Class<? extends RegionSplitPolicy> clazz = getSplitPolicyClass( region.getTableDesc(), conf); RegionSplitPolicy policy = ReflectionUtils.newInstance(clazz, conf); policy.c...
### Question: RegionSplitPolicy extends Configured { protected byte[] getSplitPoint() { byte[] explicitSplitPoint = this.region.getExplicitSplitPoint(); if (explicitSplitPoint != null) { return explicitSplitPoint; } Map<byte[], Store> stores = region.getStores(); byte[] splitPointFromLargestStore = null; long largestSt...
### Question: LRUDictionary implements Dictionary { @Override public short addEntry(byte[] data, int offset, int length) { if (length <= 0) return NOT_IN_DICTIONARY; return backingStore.put(data, offset, length); } @Override byte[] getEntry(short idx); @Override short findEntry(byte[] data, int offset, int length); @O...
### Question: FSTableDescriptors implements TableDescriptors { static int getTableInfoSequenceid(final Path p) { if (p == null) return 0; Matcher m = SUFFIX.matcher(p.getName()); if (!m.matches()) throw new IllegalArgumentException(p.toString()); String suffix = m.group(2); if (suffix == null || suffix.length() <= 0) r...
### Question: LRUDictionary implements Dictionary { @Override public short findEntry(byte[] data, int offset, int length) { short ret = backingStore.findIdx(data, offset, length); if (ret == NOT_IN_DICTIONARY) { addEntry(data, offset, length); } return ret; } @Override byte[] getEntry(short idx); @Override short findE...
### Question: SnapshotTask implements ForeignExceptionSnare, Callable<Void> { public void snapshotFailure(String message, Exception e) { ForeignException ee = new ForeignException(message, e); errorMonitor.receive(ee); } SnapshotTask(SnapshotDescription snapshot, ForeignExceptionDispatcher monitor); void snapshotFailur...
### Question: ExportSnapshot extends Configured implements Tool { static List<List<Path>> getBalancedSplits(final List<Pair<Path, Long>> files, int ngroups) { Collections.sort(files, new Comparator<Pair<Path, Long>>() { public int compare(Pair<Path, Long> a, Pair<Path, Long> b) { long r = a.getSecond() - b.getSecond();...
### Question: SnapshotDescriptionUtils { public static SnapshotDescription validate(SnapshotDescription snapshot, Configuration conf) throws IllegalArgumentException { if (!snapshot.hasTable()) { throw new IllegalArgumentException( "Descriptor doesn't apply to a table, so we can't build it."); } long time = snapshot.ge...
### Question: FSTableDescriptors implements TableDescriptors { static String formatTableInfoSequenceId(final int number) { byte [] b = new byte[WIDTH_OF_SEQUENCE_ID]; int d = Math.abs(number); for (int i = b.length - 1; i >= 0; i--) { b[i] = (byte)((d % 10) + '0'); d /= 10; } return Bytes.toString(b); } FSTableDescript...
### Question: SnapshotDescriptionUtils { public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, FileSystem fs) throws SnapshotCreationException, IOException { Path finishedDir = getCompletedSnapshotDir(snapshot, rootdir); LOG.debug("Snapshot is done, just moving the snapshot fr...
### Question: ReferenceRegionHFilesTask extends SnapshotTask { @Override public Void call() throws IOException { FileStatus[] families = FSUtils.listStatus(fs, regiondir, new FSUtils.FamilyDirFilter(fs)); if (families == null || families.length == 0) { LOG.info("No families under region directory:" + regiondir + ", not...
### Question: CopyRecoveredEditsTask extends SnapshotTask { @Override public Void call() throws IOException { NavigableSet<Path> files = HLog.getSplitEditFilesSorted(this.fs, regiondir); if (files == null || files.size() == 0) return null; for (Path source : files) { FileStatus stat = fs.getFileStatus(source); if (stat...
### Question: HTableDescriptor implements WritableComparable<HTableDescriptor> { public long getMaxFileSize() { byte [] value = getValue(MAX_FILESIZE_KEY); if (value != null) { return Long.parseLong(Bytes.toString(value)); } return -1; } protected HTableDescriptor(final byte [] name, HColumnDescriptor[] families); pro...
### Question: HTableDescriptor implements WritableComparable<HTableDescriptor> { public long getMemStoreFlushSize() { byte [] value = getValue(MEMSTORE_FLUSHSIZE_KEY); if (value != null) { return Long.parseLong(Bytes.toString(value)); } return -1; } protected HTableDescriptor(final byte [] name, HColumnDescriptor[] fa...
### Question: CatalogTracker { public boolean verifyRootRegionLocation(final long timeout) throws InterruptedException, IOException { HRegionInterface connection = null; try { connection = waitForRootServerConnection(timeout); } catch (NotAllMetaRegionsOnlineException e) { } catch (ServerNotRunningYetException e) { } c...
### Question: CatalogTracker { public void waitForRoot() throws InterruptedException { this.rootRegionTracker.blockUntilAvailable(); } CatalogTracker(final Configuration conf); CatalogTracker(final ZooKeeperWatcher zk, final Configuration conf, Abortable abortable); CatalogTracker(final ZooKeeperWatcher zk, fi...
### Question: FSTableDescriptors implements TableDescriptors { @Override public HTableDescriptor get(final byte [] tablename) throws IOException { return get(Bytes.toString(tablename)); } FSTableDescriptors(final FileSystem fs, final Path rootdir); FSTableDescriptors(final FileSystem fs, final Path rootdir, fina...
### Question: HRegionLocation implements Comparable<HRegionLocation> { public int compareTo(HRegionLocation o) { int result = this.hostname.compareTo(o.getHostname()); if (result != 0) return result; return this.port - o.getPort(); } HRegionLocation(HRegionInfo regionInfo, final String hostname, final int port); ...
### Question: CatalogTracker { public void waitForMeta() throws InterruptedException { while (!this.stopped) { try { if (waitForMeta(100) != null) break; } catch (NotAllMetaRegionsOnlineException e) { if (LOG.isTraceEnabled()) { LOG.info(".META. still not available, sleeping and retrying." + " Reason: " + e.getMessage(...
### Question: CatalogTracker { public ServerName getRootLocation() throws InterruptedException { return this.rootRegionTracker.getRootRegionLocation(); } CatalogTracker(final Configuration conf); CatalogTracker(final ZooKeeperWatcher zk, final Configuration conf, Abortable abortable); CatalogTracker(final ZooK...
### Question: ThriftHBaseServiceHandler implements THBaseService.Iface { @Override public boolean exists(ByteBuffer table, TGet get) throws TIOError, TException { HTableInterface htable = getTable(table.array()); try { return htable.exists(getFromThrift(get)); } catch (IOException e) { throw getTIOError(e); } finally {...
### Question: ThriftHBaseServiceHandler implements THBaseService.Iface { @Override public List<TDelete> deleteMultiple(ByteBuffer table, List<TDelete> deletes) throws TIOError, TException { HTableInterface htable = getTable(table.array()); List<Delete> tempDeletes = deletesFromThrift(deletes); try { htable.delete(tempD...
### Question: ThriftHBaseServiceHandler implements THBaseService.Iface { @Override public TResult increment(ByteBuffer table, TIncrement increment) throws TIOError, TException { HTableInterface htable = getTable(table.array()); try { return resultFromHBase(htable.increment(incrementFromThrift(increment))); } catch (IOE...
### Question: ThriftHBaseServiceHandler implements THBaseService.Iface { @Override public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, TException { HTableInterface htable = getTable(table.array()); try { return htable.checkAn...
### Question: ThriftHBaseServiceHandler implements THBaseService.Iface { @Override public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) throws TIOError, TException { HTableInterface htable = getTable(table.array()); try { if (va...
### Question: DynamicClassLoader extends ClassLoaderBase { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return parent.loadClass(name); } catch (ClassNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Class " + name + " not found - using dynamical class loader"); } sy...
### Question: MRApps extends Apps { public static String toString(JobId jid) { return jid.toString(); } if(userClassesTakesPrecedence); static String toString(JobId jid); static JobId toJobID(String jid); static String toString(TaskId tid); static TaskId toTaskID(String tid); static String toString(TaskAttemptId taid);...
### Question: IdLock { void assertMapEmpty() { assert map.size() == 0; } Entry getLockEntry(long id); void releaseLockEntry(Entry entry); }### Answer: @Test public void testMultipleClients() throws Exception { ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS); try { ExecutorCompletionService<Boolean> e...
### Question: MRApps extends Apps { public static JobId toJobID(String jid) { return TypeConverter.toYarn(JobID.forName(jid)); } if(userClassesTakesPrecedence); static String toString(JobId jid); static JobId toJobID(String jid); static String toString(TaskId tid); static TaskId toTaskID(String tid); static String toSt...
### Question: MRApps extends Apps { public static TaskId toTaskID(String tid) { return TypeConverter.toYarn(TaskID.forName(tid)); } if(userClassesTakesPrecedence); static String toString(JobId jid); static JobId toJobID(String jid); static String toString(TaskId tid); static TaskId toTaskID(String tid); static String t...
### Question: MRApps extends Apps { public static TaskAttemptId toTaskAttemptID(String taid) { return TypeConverter.toYarn(TaskAttemptID.forName(taid)); } if(userClassesTakesPrecedence); static String toString(JobId jid); static JobId toJobID(String jid); static String toString(TaskId tid); static TaskId toTaskID(Strin...
### Question: FileNameIndexUtils { public static String getDoneFileName(JobIndexInfo indexInfo) throws IOException { StringBuilder sb = new StringBuilder(); sb.append(escapeDelimiters(TypeConverter.fromYarn(indexInfo.getJobId()).toString())); sb.append(DELIMITER); sb.append(indexInfo.getSubmitTime()); sb.append(DELIMIT...
### Question: FileNameIndexUtils { public static JobIndexInfo getIndexInfo(String jhFileName) throws IOException { String fileName = jhFileName.substring(0, jhFileName.indexOf(JobHistoryUtils.JOB_HISTORY_FILE_EXTENSION)); JobIndexInfo indexInfo = new JobIndexInfo(); String[] jobDetails = fileName.split(DELIMITER); JobI...
### Question: CompletedTask implements Task { @Override public synchronized TaskReport getReport() { if (report == null) { constructTaskReport(); } return report; } CompletedTask(TaskId taskId, TaskInfo taskInfo); @Override boolean canCommit(TaskAttemptId taskAttemptID); @Override TaskAttempt getAttempt(TaskAttemptId a...
### Question: TokenCache { public static void cleanUpTokenReferral(Configuration conf) { conf.unset(MRJobConfig.MAPREDUCE_JOB_CREDENTIALS_BINARY); } static byte[] getSecretKey(Credentials credentials, Text alias); static void obtainTokensForNamenodes(Credentials credentials, Path[] ps, Configuration conf); stati...
### Question: ShuffleScheduler { public synchronized void tipFailed(TaskID taskId) { if (!finishedMaps[taskId.getId()]) { finishedMaps[taskId.getId()] = true; if (--remainingMaps == 0) { notifyAll(); } updateStatus(); } } ShuffleScheduler(JobConf job, TaskStatus status, ExceptionReporter repor...
### Question: Counters extends AbstractCounters<Counters.Counter, Counters.Group> { public Counters() { super(groupFactory); } Counters(); Counters(org.apache.hadoop.mapreduce.Counters newCounters); synchronized Group getGroup(String groupName); @SuppressWarnings("unchecked") synchronized Collection<String> getGroupNa...
### Question: Counters extends AbstractCounters<Counters.Counter, Counters.Group> { public synchronized Counter findCounter(String group, String name) { if (name.equals("MAP_INPUT_BYTES")) { LOG.warn("Counter name MAP_INPUT_BYTES is deprecated. " + "Use FileInputFormatCounters as group name and " + " BYTES_READ as coun...