@VisibleForTesting public TransactionHolder(TXN handle, long transactionStartTime) { this.handle = handle; this.transactionStartTime = transactionStartTime; }
@VisibleForTesting LinkedMap getPendingOffsetsToCommit() { return pendingOffsetsToCommit; } }
@VisibleForTesting CoGroupedStreams.WithWindow<T1, T2, KEY, W> getCoGroupedWindowedStream() { return coGroupedWindowedStream; } }
@VisibleForTesting long getAllowedLateness() { return allowedLateness; } }
@VisibleForTesting ResourceID getResourceId() { return resourceId; } }
@VisibleForTesting public TypeSerializer<Object>[] getFieldSerializers() { return fieldSerializers; } }
@VisibleForTesting MapState<Long, List<BufferEntry<T2>>> getRightBuffer() { return rightBuffer; } }
@VisibleForTesting Method getMethod() { return method; } }
@VisibleForTesting Map<BucketID, Bucket<IN, BucketID>> getActiveBuckets() { return activeBuckets; } }
/** * Used for testing only. */ @VisibleForTesting protected <K, V> KafkaProducer<K, V> getKafkaProducer(Properties props) { return new KafkaProducer<>(props); }
/** * @return {@code true} is the status of the service * is {@link #STATUS_ALIVE}, {@code false} otherwise. */ @VisibleForTesting boolean isAlive() { return status.get() == STATUS_ALIVE; }
@Nullable @VisibleForTesting PartFileWriter<IN, BucketID> getInProgressPart() { return inProgressPart; }
@VisibleForTesting static String replaceInvalidChars(final String input) { // https://prometheus.io/docs/instrumenting/writing_exporters/ // Only [a-zA-Z0-9:_] are valid in metric names, any other characters should be sanitized to an underscore. return UNALLOWED_CHAR_PATTERN.matcher(input).replaceAll("_"); }
@VisibleForTesting static void resetRocksDBLoadedFlag() throws Exception { final Field initField = org.rocksdb.NativeLibraryLoader.class.getDeclaredField("initialized"); initField.setAccessible(true); initField.setBoolean(null, false); } }
@VisibleForTesting public final int getNumberOfRegisteredCloseables() { synchronized (getSynchronizationLock()) { return closeableToRef.size(); } }
@VisibleForTesting public final boolean isCloseableRegistered(Closeable c) { synchronized (getSynchronizationLock()) { return closeableToRef.containsKey(c); } } }
@VisibleForTesting boolean isAmbiguousCompositeKeyPossible(TypeSerializer<?> namespaceSerializer) { return keySerializerTypeVariableSized & RocksDBKeySerializationUtils.isSerializerTypeVariableSized(namespaceSerializer); } }
@VisibleForTesting protected InputChannelStatus getInputChannelStatus(int channelIndex) { Preconditions.checkArgument( channelIndex >= 0 && channelIndex < channelStatuses.length, "Invalid channel index. Number of input channels: " + channelStatuses.length); return channelStatuses[channelIndex]; } }
@VisibleForTesting static HadoopConfigLoader createHadoopConfigLoader() { return new HadoopConfigLoader(FLINK_CONFIG_PREFIXES, MIRRORED_CONFIG_KEYS, "fs.s3a.", PACKAGE_PREFIXES_TO_SHADE, CONFIG_KEYS_TO_SHADE, FLINK_SHADING_PREFIX); }
@VisibleForTesting ElasticsearchSink.Builder<Tuple2<Boolean, Row>> createBuilder( ElasticsearchUpsertSinkFunction upsertSinkFunction, List<HttpHost> httpHosts) { return new ElasticsearchSink.Builder<>(httpHosts, upsertSinkFunction); }