comment
stringlengths
22
3.02k
method_body
stringlengths
46
368k
target_code
stringlengths
0
181
method_body_after
stringlengths
12
368k
context_before
stringlengths
11
634k
context_after
stringlengths
11
632k
Thanks for the suggestion! I was unhappy about the various wait times and time-dependent checks, but didn't know a proper way to handle it.
public void testCachedStatsCleanedAfterCleanupInterval() throws Exception { final Duration cleanUpInterval2 = Duration.ofMillis(1); final long waitingTime = cleanUpInterval2.toMillis() + 10; Cache<JobVertexThreadInfoTracker.Key, JobVertexThreadInfoStats> vertexStatsCache = ...
Thread.sleep(waitingTime);
public void testCachedStatsCleanedAfterCleanupInterval() throws Exception { final Duration shortCleanUpInterval = Duration.ofMillis(1); CountDownLatch cacheExpired = new CountDownLatch(1); Cache<JobVertexThreadInfoTracker.Key, JobVertexThreadInfoStats> vertexStatsCache = ...
class JobVertexThreadInfoTrackerTest extends TestLogger { private static final int REQUEST_ID = 0; private static final ExecutionJobVertex EXECUTION_JOB_VERTEX = createExecutionJobVertex(); private static final ExecutionVertex[] TASK_VERTICES = EXECUTION_JOB_VERTEX.getTaskVertices(); private static fin...
class JobVertexThreadInfoTrackerTest extends TestLogger { private static final int REQUEST_ID = 0; private static final ExecutionJobVertex EXECUTION_JOB_VERTEX = createExecutionJobVertex(); private static final ExecutionVertex[] TASK_VERTICES = EXECUTION_JOB_VERTEX.getTaskVertices(); private static fin...
If we have many windows, we'll have many calls to ProcessElement and block sequentially, only overlapping closes with single window processing instead of multiple. Could we instead block if the # of closing but not yet closed writers exceeds some amount (which could be controlled by an option)?
public void processElement(ProcessContext c, BoundedWindow window) throws Exception { getDynamicDestinations().setSideInputAccessorFromProcessContext(c); Map<DestinationT, Writer<DestinationT, OutputT>> writers = Maps.newHashMap(); for (UserT input : c.element().getValue()) { ...
public void processElement(ProcessContext c, BoundedWindow window) throws Exception { getDynamicDestinations().setSideInputAccessorFromProcessContext(c); PaneInfo paneInfo = c.pane(); DestinationT destination = getDynamicDestinations().getDestination(c.element()); ...
class WriteUnshardedTempFilesFn extends DoFn<UserT, FileResult<DestinationT>> { private final @Nullable TupleTag<KV<ShardedKey<Integer>, UserT>> unwrittenRecordsTag; private final Coder<DestinationT> destinationCoder; private @Nullable Map<WriterKey<DestinationT>, Writer<DestinationT, OutputT>> writer...
class WriteUnshardedTempFilesFn extends DoFn<UserT, FileResult<DestinationT>> { private final @Nullable TupleTag<KV<ShardedKey<Integer>, UserT>> unwrittenRecordsTag; private final Coder<DestinationT> destinationCoder; private @Nullable Map<WriterKey<DestinationT>, Writer<DestinationT, OutputT>> writer...
`targetColumns` may not include some of the auto-increment key columns, but the union of `targetColumns` and all auto-increment key columns are all the table columns, is that OK?
public static void analyze(InsertStmt insertStmt, ConnectContext session) { QueryRelation query = insertStmt.getQueryStatement().getQueryRelation(); new QueryAnalyzer(session).analyze(insertStmt.getQueryStatement()); List<Table> tables = new ArrayList<>(); AnalyzerUtils.collectSpecifyEx...
if (numSpecifiedKeyColumns != olapTable.getKeysNum()) {
public static void analyze(InsertStmt insertStmt, ConnectContext session) { QueryRelation query = insertStmt.getQueryStatement().getQueryRelation(); new QueryAnalyzer(session).analyze(insertStmt.getQueryStatement()); List<Table> tables = new ArrayList<>(); AnalyzerUtils.collectSpecifyEx...
class InsertAnalyzer { private static void checkStaticKeyPartitionInsert(InsertStmt insertStmt, Table table, PartitionNames targetPartitionNames) { List<String> partitionColNames = targetPartitionNames.getPartitionColNames(); List<Expr> partitionColValues = targetPartitionNames.getPartitionCol...
class InsertAnalyzer { private static void checkStaticKeyPartitionInsert(InsertStmt insertStmt, Table table, PartitionNames targetPartitionNames) { List<String> partitionColNames = targetPartitionNames.getPartitionColNames(); List<Expr> partitionColValues = targetPartitionNames.getPartitionCol...
You should be able to remove a key that isn't there so you won't need to filter for keys that exist since that is expected to be slow if we need to read them all from the runner. If we knew that we had them all in memory already then it would be worthwhile to filter upfront.
public void asyncClose() throws Exception { checkState( !isClosed, "Multimap user state is no longer usable because it is closed for %s", keysStateRequest.getStateKey()); if (!isCleared && pendingRemoves.isEmpty() && pendingAdds.isEmpty()) { isClosed = true; return; ...
Iterable<K> removeKeys = Iterables.filter(getPersistedKeys(), pendingRemoves::contains);
public void asyncClose() throws Exception { checkState( !isClosed, "Multimap user state is no longer usable because it is closed for %s", keysStateRequest.getStateKey()); isClosed = true; if (!isCleared && pendingRemoves.isEmpty() && pendingAdds.isEmpty()) { return; } ...
class MultimapUserState<K, V> { private final BeamFnStateClient beamFnStateClient; private final Coder<K> mapKeyCoder; private final Coder<V> valueCoder; private final String stateId; private final StateRequest keysStateRequest; private final StateRequest userStateRequest; private boolean isClosed; pr...
class MultimapUserState<K, V> { private final BeamFnStateClient beamFnStateClient; private final Coder<K> mapKeyCoder; private final Coder<V> valueCoder; private final String stateId; private final StateRequest keysStateRequest; private final StateRequest userStateRequest; private boolean isClosed; pr...
Required, protobuf Message not allow to use `null`
private void startCDCClient() { ImportDataSourceParameter importDataSourceParam = new ImportDataSourceParameter(appendExtraParam(getActualJdbcUrlTemplate(DS_4, false, 0)), getUsername(), getPassword()); StartCDCClientParameter parameter = new StartCDCClientParameter(importDataSourceParam); param...
String schema = "";
private void startCDCClient() { ImportDataSourceParameter importDataSourceParam = new ImportDataSourceParameter(appendExtraParam(getActualJdbcUrlTemplate(DS_4, false, 0)), getUsername(), getPassword()); StartCDCClientParameter parameter = new StartCDCClientParameter(importDataSourceParam); param...
class CDCE2EIT extends PipelineBaseE2EIT { private static final String REGISTER_STORAGE_UNIT_SQL = "REGISTER STORAGE UNIT ds_0 ( URL='${ds0}', USER='${user}', PASSWORD='${password}')," + "ds_1 ( URL='${ds1}', USER='${user}', PASSWORD='${password}')"; private static final String CREATE_SHAR...
class CDCE2EIT extends PipelineBaseE2EIT { private static final String CREATE_SHARDING_RULE_SQL = String.format("CREATE SHARDING TABLE RULE t_order(" + "STORAGE_UNITS(%s,%s)," + "SHARDING_COLUMN=user_id," + "TYPE(NAME='hash_mod',PROPERTIES('sharding-count'='4'))," ...
Here, we use the binding pattern as it is with the `toSourceCode` API. Shall we check whether the user experience with the various binding pattern options? Specially the list and map binding pattern https://ballerina.io/spec/lang/master/#binding-pattern
public Optional<DocumentSymbol> transform(ModuleVariableDeclarationNode moduleVariableDeclarationNode) { String name = moduleVariableDeclarationNode.typedBindingPattern().bindingPattern().toSourceCode(); SymbolKind symbolKind = SymbolKind.Variable; Range range = DocumentSymbolUtil.generateNodeRa...
String name = moduleVariableDeclarationNode.typedBindingPattern().bindingPattern().toSourceCode();
public Optional<DocumentSymbol> transform(ModuleVariableDeclarationNode moduleVariableDeclarationNode) { BindingPatternNode bindingPatternNode = moduleVariableDeclarationNode.typedBindingPattern().bindingPattern(); if (bindingPatternNode.kind() != SyntaxKind.CAPTURE_BINDING_PATTERN) { ...
class DocumentSymbolResolver extends NodeTransformer<Optional<DocumentSymbol>> { private List<DocumentSymbol> documentSymbolStore; private DocumentSymbolContext context; DocumentSymbolResolver(DocumentSymbolContext context) { this.context = context; documentSymbolStore = new ArrayList<>();...
class DocumentSymbolResolver extends NodeTransformer<Optional<DocumentSymbol>> { private List<DocumentSymbol> documentSymbolStore; private DocumentSymbolContext context; DocumentSymbolResolver(DocumentSymbolContext context) { this.context = context; documentSymbolStore = new ArrayList<>();...
IMO, it is a kind of an unnecessary call since we change the implicit casts into expressions within the `addConversionExprIfRequired`. Is there any other specific reason to call `rewriteExpr` here?
private BLangBlockStmt desugarForeachToWhile(BLangForeach foreach, BLangSimpleVariableDef varDef) { ...
result = addConversionExprIfRequired(literal, varRefExpr.getBType());
private BLangBlockStmt desugarForeachToWhile(BLangForeach foreach, BLangSimpleVariableDef varDef) { ...
class definition node for which the initializer is created * @param env The env for the type node * @return The generated initializer method */ private BLangFunction createGeneratedInitializerFunction(BLangClassDefinition classDefinition, SymbolEnv env) { BLangFunction generatedIni...
class definition node for which the initializer is created * @param env The env for the type node * @return The generated initializer method */ private BLangFunction createGeneratedInitializerFunction(BLangClassDefinition classDefinition, SymbolEnv env) { BLangFunction generatedIni...
This can not be `checkState(writer == null)` because single dispatcher will handle 5 `CheckpointStartRequests` from 5 subtasks (assuming 5 subtasks are configured to share the same file?). If so, maybe add a comment explaining this?
private void dispatchInternal(ChannelStateWriteRequest request) throws Exception { if (request instanceof SubtaskRegisterRequest) { SubtaskRegisterRequest req = (SubtaskRegisterRequest) request; SubtaskID subtaskID = SubtaskID.of(req.getJobID(), req.getJobVertexID(), ...
if (writer == null) {
private void dispatchInternal(ChannelStateWriteRequest request) throws Exception { if (request instanceof SubtaskRegisterRequest) { SubtaskRegisterRequest req = (SubtaskRegisterRequest) request; SubtaskID subtaskID = SubtaskID.of(req.getJobVertexID(), req.getSubtaskIndex()); ...
class ChannelStateWriteRequestDispatcherImpl implements ChannelStateWriteRequestDispatcher { private static final Logger LOG = LoggerFactory.getLogger(ChannelStateWriteRequestDispatcherImpl.class); private final CheckpointStorage checkpointStorage; private final JobID jobID; private final...
class ChannelStateWriteRequestDispatcherImpl implements ChannelStateWriteRequestDispatcher { private static final Logger LOG = LoggerFactory.getLogger(ChannelStateWriteRequestDispatcherImpl.class); private final CheckpointStorage checkpointStorage; private final JobID jobID; private final...
Can you modify the kernel logic instead of sql parse logic?
private BinaryOperationExpression createPatternMatchingOperationSegment(final AExprContext ctx) { String operator = getOriginalText(ctx.patternMatchingOperator()).toUpperCase(); ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0)); ListExpression right = new ListExpression(ctx.aExpr(...
String operator = getOriginalText(ctx.patternMatchingOperator()).toUpperCase();
private BinaryOperationExpression createPatternMatchingOperationSegment(final AExprContext ctx) { String operator = getOriginalText(ctx.patternMatchingOperator()).toUpperCase(); ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0)); ListExpression right = new ListExpression(ctx.aExpr(...
class PostgreSQLStatementSQLVisitor extends PostgreSQLStatementParserBaseVisitor<ASTNode> { private final Collection<ParameterMarkerSegment> parameterMarkerSegments = new LinkedList<>(); public PostgreSQLStatementSQLVisitor(final Properties props) { } @Override public final ASTNode vi...
class PostgreSQLStatementSQLVisitor extends PostgreSQLStatementParserBaseVisitor<ASTNode> { private final Collection<ParameterMarkerSegment> parameterMarkerSegments = new LinkedList<>(); public PostgreSQLStatementSQLVisitor(final Properties props) { } @Override public final ASTNode vi...
Shouldn't this be `max.nodes() / min.groups()` ?
public Capacity applyOn(Capacity capacity, ApplicationId application, boolean exclusive) { var min = applyOn(capacity.minResources(), capacity, application, exclusive); var max = applyOn(capacity.maxResources(), capacity, application, exclusive); var groupSize = capacity.groupSize().fromAtMost(m...
var groupSize = capacity.groupSize().fromAtMost(max.nodes() / max.groups())
public Capacity applyOn(Capacity capacity, ApplicationId application, boolean exclusive) { var min = applyOn(capacity.minResources(), capacity, application, exclusive); var max = applyOn(capacity.maxResources(), capacity, application, exclusive); var groupSize = capacity.groupSize().fromAtMost(m...
class CapacityPolicies { private final NodeRepository nodeRepository; private final Zone zone; private final StringFlag adminClusterNodeArchitecture; public CapacityPolicies(NodeRepository nodeRepository) { this.nodeRepository = nodeRepository; this.zone = nodeRepository.zone(); ...
class CapacityPolicies { private final NodeRepository nodeRepository; private final Zone zone; private final StringFlag adminClusterNodeArchitecture; public CapacityPolicies(NodeRepository nodeRepository) { this.nodeRepository = nodeRepository; this.zone = nodeRepository.zone(); ...
Just move the toByteArray call to the test and out of the implementation to prevent its use
public static byte[] getPosition(@Nullable ShufflePosition shufflePosition) { if (shufflePosition == null) { return null; } Preconditions.checkArgument(shufflePosition instanceof ByteArrayShufflePosition); ByteArrayShufflePosition adapter = (ByteArrayShufflePosition) shufflePosition; return ad...
return adapter.getPosition().toByteArray();
public static byte[] getPosition(@Nullable ShufflePosition shufflePosition) { if (shufflePosition == null) { return null; } Preconditions.checkArgument(shufflePosition instanceof ByteArrayShufflePosition); ByteArrayShufflePosition adapter = (ByteArrayShufflePosition) shufflePosition; return ad...
class ByteArrayShufflePosition implements Comparable<ShufflePosition>, ShufflePosition { private static final ByteString ZERO = ByteString.copyFrom(new byte[] {0}); private final ByteString position; public ByteArrayShufflePosition(ByteString position) { this.position = position; } public static ByteArr...
class ByteArrayShufflePosition implements Comparable<ShufflePosition>, ShufflePosition { private static final ByteString ZERO = ByteString.copyFrom(new byte[] {0}); private final ByteString position; public ByteArrayShufflePosition(ByteString position) { this.position = position; } public static ByteArr...
Log the exception as the last parameter in this.
public String serializeRaw(Object object) { final ClientLogger logger = new ClientLogger(JacksonAdapter.class); if (object == null) { return null; } try { return serialize(object, SerializerEncoding.JSON).replaceAll("^\"*", "").replaceAll("\"*$", ""); } ca...
logger.warning("Failed to serialize {} to JSON.", object.getClass());
public String serializeRaw(Object object) { if (object == null) { return null; } try { return serialize(object, SerializerEncoding.JSON).replaceAll("^\"*", "").replaceAll("\"*$", ""); } catch (IOException ex) { logger.warning("Failed to serialize {} to...
class JacksonAdapter implements SerializerAdapter { private final ClientLogger logger = new ClientLogger(JacksonAdapter.class); /** * An instance of {@link ObjectMapper} to serialize/deserialize objects. */ private final ObjectMapper mapper; /** * An instance of {@link ObjectMapper} tha...
class JacksonAdapter implements SerializerAdapter { private final ClientLogger logger = new ClientLogger(JacksonAdapter.class); /** * An instance of {@link ObjectMapper} to serialize/deserialize objects. */ private final ObjectMapper mapper; /** * An instance of {@link ObjectMapper} tha...
I modified this logic to work regardless of the position of the delimiter.
public void handle(Buffer buffer) { try { byte[] bytes = buffer.getBytes(); MediaType mediaType = response.getMediaType(); if (isNewlineDelimited) { String charset = mediaType.getParameters().get(MediaType.CHARSET_PARAM...
String charset = mediaType.getParameters().get(MediaType.CHARSET_PARAMETER);
public void handle(Buffer buffer) { try { byte[] bytes = buffer.getBytes(); MediaType mediaType = response.getMediaType(); if (isNewlineDelimited) { String charset = mediaType.getParameters().get(MediaType.CHARSET_PARAM...
class MultiRequest<R> { private final AtomicReference<Runnable> onCancel = new AtomicReference<>(); private final MultiEmitter<? super R> emitter; private static final Runnable CLEARED = () -> { }; public MultiRequest(MultiEmitter<? super R> emitter) { this.emitte...
class MultiRequest<R> { private final AtomicReference<Runnable> onCancel = new AtomicReference<>(); private final MultiEmitter<? super R> emitter; private static final Runnable CLEARED = () -> { }; public MultiRequest(MultiEmitter<? super R> emitter) { this.emitte...
This is an improvement. I'm a bit sceptical of the method API: Usually, some condition has led to the caller wanting to set this node to dirty. I would guess that whole condition needs to be reevaluated under the unallocated lock? More than just the presence of the node may have changed between testing the condition...
private List<Node> performOn(NodeFilter filter, BiFunction<Node, Mutex, Node> action) { List<Node> unallocatedNodes = new ArrayList<>(); ListMap<ApplicationId, Node> allocatedNodes = new ListMap<>(); for (Node node : db.readNodes()) { if ( ! filter.matches(node)) continue; ...
Optional<Node> currentNode = db.readNode(node.hostname());
private List<Node> performOn(NodeFilter filter, BiFunction<Node, Mutex, Node> action) { List<Node> unallocatedNodes = new ArrayList<>(); ListMap<ApplicationId, Node> allocatedNodes = new ListMap<>(); for (Node node : db.readNodes()) { if ( ! filter.matches(node)) continue; ...
class NodeRepository extends AbstractComponent { private static final Logger log = Logger.getLogger(NodeRepository.class.getName()); private final CuratorDatabaseClient db; private final Clock clock; private final Zone zone; private final NodeFlavors flavors; private final HostResourcesCalcula...
class NodeRepository extends AbstractComponent { private static final Logger log = Logger.getLogger(NodeRepository.class.getName()); private final CuratorDatabaseClient db; private final Clock clock; private final Zone zone; private final NodeFlavors flavors; private final HostResourcesCalcula...
I think you should set this to null.
public PubsubMessage(byte[] payload, Map<String, String> attributes) { this.message = payload; this.attributes = attributes; this.messageId = ""; }
this.messageId = "";
public PubsubMessage(byte[] payload, Map<String, String> attributes) { this.message = payload; this.attributes = attributes; this.messageId = null; }
class PubsubMessage { private byte[] message; private Map<String, String> attributes; private String messageId; public PubsubMessage(byte[] payload, Map<String, String> attributes, String messageId) { this.message = payload; this.attributes = attributes; this.messageId = messageId; } /** ...
class PubsubMessage { private byte[] message; private Map<String, String> attributes; private String messageId; public PubsubMessage(byte[] payload, Map<String, String> attributes, String messageId) { this.message = payload; this.attributes = attributes; this.messageId = messageId; } /** ...
If you disable additivity, then the lines are not forwarded to the parent logger. The consequence is that the lines disappear for the user.
protected void before() throws Throwable { loggingEvents = new ConcurrentLinkedQueue<>(); final LoggerConfig previousLoggerConfig = LOGGER_CONTEXT.getConfiguration().getLoggerConfig(loggerName); final Level previousLevel = previousLoggerConfig.getLevel(); final Level us...
null,
protected void before() throws Throwable { loggingEvents = new ConcurrentLinkedQueue<>(); final LoggerConfig previousLoggerConfig = LOGGER_CONTEXT.getConfiguration().getLoggerConfig(loggerName); final Level previousLevel = previousLoggerConfig.getLevel(); final Level us...
class TestLoggerResource extends ExternalResource { private static final LoggerContext LOGGER_CONTEXT = (LoggerContext) LogManager.getContext(false); private final String loggerName; private final org.slf4j.event.Level level; @Nullable private LoggerConfig backupLoggerConfig = null; pr...
class TestLoggerResource extends ExternalResource { private static final LoggerContext LOGGER_CONTEXT = (LoggerContext) LogManager.getContext(false); private final String loggerName; private final org.slf4j.event.Level level; @Nullable private LoggerConfig backupLoggerConfig = null; pr...
Negative is an interesting situation, but you are right makes sense, removed the reduandant check
private Duration calculateRenewalDelay(OffsetDateTime initialLockedUntil) { final OffsetDateTime now = OffsetDateTime.now(); final Duration remainingTime = Duration.between(now, initialLockedUntil); if (remainingTime.isNegative() || remainingTime.toMillis() < 400) { ...
if (remainingTime.isNegative() || remainingTime.toMillis() < 400) {
private Duration calculateRenewalDelay(OffsetDateTime initialLockedUntil) { final OffsetDateTime now = OffsetDateTime.now(); final Duration remainingTime = Duration.between(now, initialLockedUntil); if (remainingTime.toMillis() < 400) { logger.info("Durat...
class LockRenewalOperation implements AutoCloseable { private final ClientLogger logger = new ClientLogger(LockRenewalOperation.class); private final AtomicBoolean isDisposed = new AtomicBoolean(); private final AtomicReference<OffsetDateTime> lockedUntil = new AtomicReference<>(); private final AtomicR...
class LockRenewalOperation implements AutoCloseable { private final ClientLogger logger = new ClientLogger(LockRenewalOperation.class); private final AtomicBoolean isDisposed = new AtomicBoolean(); private final AtomicReference<OffsetDateTime> lockedUntil = new AtomicReference<>(); private final AtomicR...
```suggestion sqlStr = op.toString() + " " + getChild(0).toSql(); ```
public ArithmeticExpr(Operator op, Expr e1, Expr e2) { super(); this.op = op; Preconditions.checkNotNull(e1); children.add(e1); Preconditions.checkArgument( op == Operator.BITNOT && e2 == null || op != Operator.BITNOT && e2 != null); if (e2 != null) { ...
sqlStr=op.toString() + " " + getChild(0).toSql();
public ArithmeticExpr(Operator op, Expr e1, Expr e2) { super(); this.op = op; Preconditions.checkNotNull(e1); children.add(e1); Preconditions.checkArgument( op == Operator.BITNOT && e2 == null || op != Operator.BITNOT && e2 != null); if (e2 != null) { ...
class ArithmeticExpr extends Expr { private static final Logger LOG = LogManager.getLogger(ArithmeticExpr.class); enum OperatorPosition { BINARY_INFIX, UNARY_PREFIX, UNARY_POSTFIX, } public enum Operator { MULTIPLY("*", "multiply", OperatorPosition.BINARY_INFIX, TExprOp...
class ArithmeticExpr extends Expr { private static final Logger LOG = LogManager.getLogger(ArithmeticExpr.class); enum OperatorPosition { BINARY_INFIX, UNARY_PREFIX, UNARY_POSTFIX, } public enum Operator { MULTIPLY("*", "multiply", OperatorPosition.BINARY_INFIX, TExprOp...
I don't know much about the use of `jboss.xnio` library, just read its documentation. I have a question here: will this run in `WORKER THREAD pool`, which was configured to 16 in `NMysqlServer`(use `Options.WORKER_TASK_MAX_THREADS`)? If it is, there may be a problem. For example: if we have 16 slow queries, such as r...
public void handleEvent(ConduitStreamSourceChannel channel) { XnioIoThread.requireCurrentThread(); ctx.suspendAcceptQuery(); channel.getWorker().execute(() -> { ctx.setThreadLocalInfo(); try { connectProcessor.processOnce(); ...
channel.getWorker().execute(() -> {
public void handleEvent(ConduitStreamSourceChannel channel) { XnioIoThread.requireCurrentThread(); ctx.suspendAcceptQuery(); channel.getWorker().execute(() -> { ctx.setThreadLocalInfo(); try { connectProcessor.processOnce(); ...
class ReadListener implements ChannelListener<ConduitStreamSourceChannel> { private final Logger LOG = LogManager.getLogger(this.getClass()); private NConnectContext ctx; private ConnectProcessor connectProcessor; public ReadListener(NConnectContext nConnectContext, ConnectProcessor connectProcessor) {...
class ReadListener implements ChannelListener<ConduitStreamSourceChannel> { private final Logger LOG = LogManager.getLogger(this.getClass()); private NConnectContext ctx; private ConnectProcessor connectProcessor; public ReadListener(NConnectContext nConnectContext, ConnectProcessor connectProcessor) {...
I'd rather not selectively lie, unless there's a good reason to do so.
public Node apply(MutableNetwork<Node, Edge> input) { for (Node node : input.nodes()) { if (node instanceof RemoteGrpcPortNode || node instanceof ParallelInstructionNode || node instanceof InstructionOutputNode) { continue; } throw new IllegalArgumentException( ...
public Node apply(MutableNetwork<Node, Edge> input) { for (Node node : input.nodes()) { if (node instanceof RemoteGrpcPortNode || node instanceof ParallelInstructionNode || node instanceof InstructionOutputNode) { continue; } throw new IllegalArgumentException( ...
class CreateExecutableStageNodeFunction implements Function<MutableNetwork<Node, Edge>, Node> { private static final String DATA_INPUT_URN = "urn:org.apache.beam:source:runner:0.1"; private static final String DATA_OUTPUT_URN = "urn:org.apache.beam:sink:runner:0.1"; private static final String JAVA_SOURCE_UR...
class CreateExecutableStageNodeFunction implements Function<MutableNetwork<Node, Edge>, Node> { private static final String DATA_INPUT_URN = "urn:org.apache.beam:source:runner:0.1"; private static final String DATA_OUTPUT_URN = "urn:org.apache.beam:sink:runner:0.1"; private static final String JAVA_SOURCE_UR...
@sd-f This null is taken care of a bit later [here](https://github.com/quarkusio/quarkus/blob/351778d3ce0aa8a44cc45328ebdc44c293d2f1bb/extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientRecorder.java#L119). We can throw the exception now but then we'd have to refactor the uni code cat...
private static Uni<String> discoverTokenEndpoint(WebClient client, String authServerUrl) { String discoveryUrl = authServerUrl + "/.well-known/openid-configuration"; return client.getAbs(discoveryUrl).send().onItem().transform(resp -> { if (resp.statusCode() == 200) { JsonObj...
throw new OidcClientException("Token endpoint discovery has failed");
private static Uni<String> discoverTokenEndpoint(WebClient client, String authServerUrl) { String discoveryUrl = authServerUrl + "/.well-known/openid-configuration"; return client.getAbs(discoveryUrl).send().onItem().transform(resp -> { if (resp.statusCode() == 200) { JsonObj...
class OidcClientRecorder { private static final Logger LOG = Logger.getLogger(OidcClientRecorder.class); private static final String DEFAULT_OIDC_CLIENT_ID = "Default"; public OidcClients setup(OidcClientsConfig oidcClientsConfig, TlsConfig tlsConfig, Supplier<Vertx> vertx) { String defaultClient...
class OidcClientRecorder { private static final Logger LOG = Logger.getLogger(OidcClientRecorder.class); private static final String DEFAULT_OIDC_CLIENT_ID = "Default"; public OidcClients setup(OidcClientsConfig oidcClientsConfig, TlsConfig tlsConfig, Supplier<Vertx> vertx) { String defaultClient...
Thank you, I agree it doesn't hold a reference to a variable here. Implemented!
private void flush() { while (inFlightRequestsCount >= maxInFlightRequests) { mailboxExecutor.tryYield(); } List<RequestEntryT> batch = new ArrayList<>(maxBatchSize); int batchSize = Math.min(maxBatchSize, bufferedRequestEntries.size()); int batchSizeBytes = 0; ...
Consumer<Exception> fatalExceptionCons =
private void flush() { while (inFlightRequestsCount >= maxInFlightRequests) { mailboxExecutor.tryYield(); } List<RequestEntryT> batch = new ArrayList<>(maxBatchSize); int batchSize = Math.min(maxBatchSize, bufferedRequestEntries.size()); int batchSizeBytes = 0; ...
class AsyncSinkWriter<InputT, RequestEntryT extends Serializable> implements SinkWriter<InputT, Void, Collection<RequestEntryT>> { private final MailboxExecutor mailboxExecutor; private final Sink.ProcessingTimeService timeService; /* The timestamp of the previous batch of records was sent from th...
class AsyncSinkWriter<InputT, RequestEntryT extends Serializable> implements SinkWriter<InputT, Void, Collection<RequestEntryT>> { private final MailboxExecutor mailboxExecutor; private final Sink.ProcessingTimeService timeService; /* The timestamp of the previous batch of records was sent from th...
Here will be a problem. For now, `DataProperty.DEFAULT_DATA_PROPERTY` is configuration, so here, it is all possible to write `true` or `false`. And when reading, `true` may point to HDD, may point to SSD, depends on the config.
public void write(DataOutput out) throws IOException { Text.writeString(out, type.name()); Preconditions.checkState(idToDataProperty.size() == idToReplicationNum.size()); Preconditions.checkState(idToInMemory.keySet().equals(idToReplicationNum.keySet())); out.writeInt(idToDataProperty.s...
if (entry.getValue() == DataProperty.DEFAULT_DATA_PROPERTY) {
public void write(DataOutput out) throws IOException { Text.writeString(out, type.name()); Preconditions.checkState(idToDataProperty.size() == idToReplicationNum.size()); Preconditions.checkState(idToInMemory.keySet().equals(idToReplicationNum.keySet())); out.writeInt(idToDataProperty.s...
class PartitionInfo implements Writable { private static final Logger LOG = LogManager.getLogger(PartitionInfo.class); protected PartitionType type; protected Map<Long, DataProperty> idToDataProperty; protected Map<Long, Short> idToReplicationNum; protected boolean isMultiColumnParti...
class PartitionInfo implements Writable { private static final Logger LOG = LogManager.getLogger(PartitionInfo.class); protected PartitionType type; protected Map<Long, DataProperty> idToDataProperty; protected Map<Long, Short> idToReplicationNum; protected boolean isMultiColumnParti...
Yes I agree `UnresolvedFieldReference` cannot be translated into RexNode and also that it should never end up in the Planner. This is also the main purpose of the `UnresolvedFieldReference` to make this distinction clear. `ExpressionVisitor` is just a way to traverse the operation tree. I am currently working on movin...
public RexNode visit(Expression other) { if (other instanceof UnresolvedFieldReferenceExpression) { return visitUnresolvedFieldReferenceExpression((UnresolvedFieldReferenceExpression) other); } else if (other instanceof ResolvedAggInputReference) { return visitResolvedAggInputReference((ResolvedAggInputRefere...
if (other instanceof UnresolvedFieldReferenceExpression) {
public RexNode visit(Expression other) { if (other instanceof UnresolvedFieldReferenceExpression) { return visitUnresolvedFieldReferenceExpression((UnresolvedFieldReferenceExpression) other); } else if (other instanceof ResolvedAggInputReference) { return visitResolvedAggInputReference((ResolvedAggInputRefere...
class RexNodeConverter implements ExpressionVisitor<RexNode> { private final RelBuilder relBuilder; private final FlinkTypeFactory typeFactory; public RexNodeConverter(RelBuilder relBuilder) { this.relBuilder = relBuilder; this.typeFactory = (FlinkTypeFactory) relBuilder.getRexBuilder().getTypeFactory(); } ...
class RexNodeConverter implements ExpressionVisitor<RexNode> { private final RelBuilder relBuilder; private final FlinkTypeFactory typeFactory; public RexNodeConverter(RelBuilder relBuilder) { this.relBuilder = relBuilder; this.typeFactory = (FlinkTypeFactory) relBuilder.getRexBuilder().getTypeFactory(); } ...
I think you can extends DefaultExpressionRewriter, and replace this line to `return super.visit(expr, substitutionMap)`
public Expression visit(Expression expr, Map<Expression, Expression> substitutionMap) { if (substitutionMap.containsKey(expr)) { return substitutionMap.get(expr); } else { List<Expression> newChildren = new Array...
List<Expression> newChildren = new ArrayList<>();
public Expression visit(Expression expr, Map<Expression, Expression> substitutionMap) { if (substitutionMap.containsKey(expr)) { return substitutionMap.get(expr); } else { List<Expression> newChildren = new Array...
class ExpressionReplacer extends ExpressionVisitor<Expression, Map<Expression, Expression>> { private static final ExpressionReplacer INSTANCE = new ExpressionReplacer(); @Override }
class ExpressionReplacer extends ExpressionVisitor<Expression, Map<Expression, Expression>> { private static final ExpressionReplacer INSTANCE = new ExpressionReplacer(); @Override }
@cescoffier maybe it's not mandatory in this case but we usually restore previous contexts in a finally block. It's not needed here?
public void handle(Promise<Object> f) { final Context previous = Context.current(); grpcContext.attach(); consumer.accept(delegate); f.complete(); grpcContext.detach(previous); }
grpcContext.detach(previous);
public void handle(Promise<Object> f) { ServerCall.Listener<ReqT> listener = next.startCall(call, headers); replay.setDelegate(listener); f.complete(null); }
class BlockingServerInterceptor implements ServerInterceptor { private final Vertx vertx; private final List<String> blockingMethods; private final Map<String, Boolean> cache = new HashMap<>(); public BlockingServerInterceptor(Vertx vertx, List<String> blockingMethods) { this.vertx = vertx; ...
class BlockingServerInterceptor implements ServerInterceptor { private final Vertx vertx; private final List<String> blockingMethods; private final Map<String, Boolean> cache = new HashMap<>(); public BlockingServerInterceptor(Vertx vertx, List<String> blockingMethods) { this.vertx = vertx; ...
There are multiple strategies to solve this specific problem, but I don't think creating a mapping will be significantly better.
private void removeDuplicateBindingsFromAccessControlChain(Http http) { Set<FilterBinding> duplicateBindings = new HashSet<>(); for (FilterBinding binding : http.getBindings()) { if (binding.filterId().toId().equals(ACCESS_CONTROL_CHAIN_ID)) { for (FilterBinding otherBinding ...
for (FilterBinding binding : http.getBindings()) {
private void removeDuplicateBindingsFromAccessControlChain(Http http) { Set<FilterBinding> duplicateBindings = new HashSet<>(); for (FilterBinding binding : http.getBindings()) { if (binding.chainId().toId().equals(ACCESS_CONTROL_CHAIN_ID)) { for (FilterBinding otherBinding :...
class Builder { private final String domain; private boolean readEnabled = false; private boolean writeEnabled = true; private final Set<BindingPattern> excludeBindings = new LinkedHashSet<>(); private Collection<Handler<?>> handlers = Collections.emptyList(); public Bui...
class Builder { private final String domain; private boolean readEnabled = false; private boolean writeEnabled = true; private final Set<BindingPattern> excludeBindings = new LinkedHashSet<>(); private Collection<Handler<?>> handlers = Collections.emptyList(); public Bui...
Also can't we have this as an actual object defined in lang.object https://github.com/ballerina-platform/ballerina-spec/issues/442#issuecomment-619482206
private BLangBlockStmt desugarForeachToWhile(BLangForeach foreach, BLangSimpleVariableDef varDef) { ...
BObjectType objectClassType = new BObjectType(classTSymbol, updatedFlags);
private BLangBlockStmt desugarForeachToWhile(BLangForeach foreach, BLangSimpleVariableDef varDef) { ...
class Desugar extends BLangNodeVisitor { private static final CompilerContext.Key<Desugar> DESUGAR_KEY = new CompilerContext.Key<>(); private static final String BASE_64 = "base64"; private static final String ERROR_REASON_FUNCTION_NAME = "reason"; private static final String ERROR_DETAIL_F...
class Desugar extends BLangNodeVisitor { private static final CompilerContext.Key<Desugar> DESUGAR_KEY = new CompilerContext.Key<>(); private static final String BASE_64 = "base64"; private static final String ERROR_REASON_FUNCTION_NAME = "reason"; private static final String ERROR_DETAIL_F...
It was more so that people know what they are using. People are used to hamcrest assertions being static but I didn't want a magic `get(...)` that people don't know where it's coming from.
public void testHealth() { try { RestAssured.defaultParser = Parser.JSON; RestAssured.when().get("/health").then() .body("outcome", is("UP"), "checks.state", contains("UP"), "checks.name", contains("basi...
RestAssured.when().get("/health").then()
public void testHealth() { try { RestAssured.defaultParser = Parser.JSON; RestAssured.when().get("/health").then() .body("outcome", is("UP"), "checks.state", contains("UP"), "checks.name", contains("basi...
class HealthUnitTest { @Deployment public static JavaArchive deploy() { return ShrinkWrap.create(JavaArchive.class) .addClasses(BasicHealthCheck.class) .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Test }
class HealthUnitTest { @Deployment public static JavaArchive deploy() { return ShrinkWrap.create(JavaArchive.class) .addClasses(BasicHealthCheck.class) .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Test }
I got your point, but it would require to annotate the `inputStream` [here](https://github.com/julianhyde/sqlline/blob/sqlline-1.4.0/src/main/java/sqlline/SqlLine.java#L615) in `begin` method with `@Nullable`, which is outside the project. What could be possible workaround here ?
private Future<List<List<String>>> runQueryInBackground(String[] args) { return pool.submit( (Callable) () -> { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); InputStream inputStream = new ByteArrayInputStream(new byte[0]); BeamSqlLine...
BeamSqlLine.runSqlLine(args, inputStream, outputStream, null);
new ByteArrayOutputStream(); BeamSqlLine.runSqlLine(args, null, outputStream, null); return toLines(outputStream); }); } private long convertTimestampToMillis(String timestamp) throws ParseException { return dateFormat.parse(timestamp).getTime(); }
class BeamSqlLineIT implements Serializable { @Rule public transient TestPubsub eventsTopic = TestPubsub.create(); private static String project = ""; private static String createPubsubTableStatement = ""; private static String setProject = ""; private static final SimpleDateFormat dateFormat = new SimpleDa...
class BeamSqlLineIT implements Serializable { @Rule public transient TestPubsub eventsTopic = TestPubsub.create(); private static String project = ""; private static String createPubsubTableStatement = ""; private static String setProject = ""; private static final SimpleDateFormat dateFormat = new SimpleDa...
I this function internal can be represented as four-argument function: topN(columnRecall, sortKeyColumn, N, desc|asc) then use this function to implement max_by and min_by.
private static void analyzeBuiltinAggFunction(FunctionCallExpr functionCallExpr) { FunctionName fnName = functionCallExpr.getFnName(); FunctionParams fnParams = functionCallExpr.getParams(); if (fnParams.isStar() && !fnName.getFunction().equals(FunctionSet.COUNT)) { throw new Semant...
if (functionCallExpr.getChildren().size() != 2 || functionCallExpr.getChildren().isEmpty()) {
private static void analyzeBuiltinAggFunction(FunctionCallExpr functionCallExpr) { FunctionName fnName = functionCallExpr.getFnName(); FunctionParams fnParams = functionCallExpr.getParams(); if (fnParams.isStar() && !fnName.getFunction().equals(FunctionSet.COUNT)) { throw new Semant...
class FunctionAnalyzer { public static void analyze(FunctionCallExpr functionCallExpr) { if (functionCallExpr.getFn() instanceof AggregateFunction) { analyzeBuiltinAggFunction(functionCallExpr); } if (functionCallExpr.getParams().isStar() && !(functionCallExpr.getFn() instanceo...
class FunctionAnalyzer { public static void analyze(FunctionCallExpr functionCallExpr) { if (functionCallExpr.getFn() instanceof AggregateFunction) { analyzeBuiltinAggFunction(functionCallExpr); } if (functionCallExpr.getParams().isStar() && !(functionCallExpr.getFn() instanceo...
```suggestion addShutdownHookAndCleanup(); // Register a shutdown hook to handle graceful shutdown of the application ```
public static void main(String[] args) throws CustomException { profilerStartTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS); tempFileCleanupShutdownHook(); printHeader(); handleProfilerArguments(args); extractTheProfiler(); createTempJar...
tempFileCleanupShutdownHook();
public static void main(String[] args) throws CustomException { profilerStartTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS); addShutdownHookAndCleanup(); printHeader(); handleProfilerArguments(args); extractProfiler(); createTempJar(balJ...
class Main { public static final String ANSI_RESET = "\u001B[0m"; public static final String ANSI_GRAY = "\033[37m"; public static final String ANSI_CYAN = "\033[1;38;2;32;182;176m"; static long profilerStartTime; static int exitCode = 0; public static final String TEMPJARFILENAME = ...
class Main { static long profilerStartTime; static int exitCode = 0; private static String balJarArgs = null; static String balJarName = null; static String skipFunctionString = null; private static int balFunctionCount = 0; static int moduleCount = 0; static final List<String> INSTRUME...
Logging a warning here might be confusion, maybe just comment that this is expected as the db already exists when running this before the 2nd test...? Though, nothing critical ....
public void prepareDatabase() throws SQLException { pipelineRead.getOptions().setStableUniqueNames(CheckEnabled.OFF); DataSource dbDs = DatabaseTestHelper.getDataSourceForContainer(getDb(dbms)); try { DatabaseTestHelper.createTable( dbDs, TABLE_NAME, Lists.newArrayList( ...
LOG.warn("Exception occurred when preparing database {}", dbms, e);
public void prepareDatabase() throws SQLException { pipelineRead.getOptions().setStableUniqueNames(CheckEnabled.OFF); DataSource dbDs = DatabaseTestHelper.getDataSourceForContainer(getDb(dbms)); try { DatabaseTestHelper.createTable( dbDs, TABLE_NAME, Lists.newArrayList( ...
class JdbcIOAutoPartitioningIT { private static final Logger LOG = LoggerFactory.getLogger(JdbcIOAutoPartitioningIT.class); public static final Integer NUM_ROWS = 1_000; public static final String TABLE_NAME = "baseTable"; @ClassRule public static TestPipeline pipelineWrite = TestPipeline.create(); @Rule pu...
class JdbcIOAutoPartitioningIT { private static final Logger LOG = LoggerFactory.getLogger(JdbcIOAutoPartitioningIT.class); public static final Integer NUM_ROWS = 1_000; public static final String TABLE_NAME = "baseTable"; @ClassRule public static TestPipeline pipelineWrite = TestPipeline.create(); @Rule pu...
The strange issue was related to HTTP/2 and solved by `executeBlocking` https://github.com/quarkusio/quarkus/issues/34912
public static Uni<HttpResponse<Buffer>> sendRequest(Vertx vertx, HttpRequest<Buffer> request, boolean blockingDnsLookup) { if (blockingDnsLookup) { return vertx.executeBlocking(new Callable<Void>() { @Override public Void call() { try { ...
return vertx.executeBlocking(new Callable<Void>() {
Override public Void call() { try { InetAddress.getByName(request.host()); } catch (UnknownHostException e) { throw new RuntimeException(e); } return n...
class OidcCommonUtils { public static final Duration CONNECTION_BACKOFF_DURATION = Duration.ofSeconds(2); static final byte AMP = '&'; static final byte EQ = '='; static final String HTTP_SCHEME = "http"; private static final Logger LOG = Logger.getLogger(OidcCommonUtils.class); private OidcC...
class OidcCommonUtils { public static final Duration CONNECTION_BACKOFF_DURATION = Duration.ofSeconds(2); static final byte AMP = '&'; static final byte EQ = '='; static final String HTTP_SCHEME = "http"; private static final Logger LOG = Logger.getLogger(OidcCommonUtils.class); private OidcC...
I think we can remove the DEFAULT_CLUSTER also. The feature is useless but only has compatibility.
public TGetDBPrivsResult getDBPrivs(TGetDBPrivsParams params) throws TException { LOG.debug("get database privileges request: {}", params); TGetDBPrivsResult result = new TGetDBPrivsResult(); List<TDBPrivDesc> tDBPrivs = Lists.newArrayList(); result.setDb_privs(tDBPrivs); UserIde...
String clusterPrefix = SystemInfoService.DEFAULT_CLUSTER + ClusterNamespace.CLUSTER_DELIMITER;
public TGetDBPrivsResult getDBPrivs(TGetDBPrivsParams params) throws TException { LOG.debug("get database privileges request: {}", params); TGetDBPrivsResult result = new TGetDBPrivsResult(); List<TDBPrivDesc> tDBPrivs = Lists.newArrayList(); result.setDb_privs(tDBPrivs); UserIde...
class FrontendServiceImpl implements FrontendService.Iface { private static final Logger LOG = LogManager.getLogger(LeaderImpl.class); private LeaderImpl leaderImpl; private ExecuteEnv exeEnv; public FrontendServiceImpl(ExecuteEnv exeEnv) { leaderImpl = new LeaderImpl(); this.exeEnv = e...
class FrontendServiceImpl implements FrontendService.Iface { private static final Logger LOG = LogManager.getLogger(LeaderImpl.class); private LeaderImpl leaderImpl; private ExecuteEnv exeEnv; public FrontendServiceImpl(ExecuteEnv exeEnv) { leaderImpl = new LeaderImpl(); this.exeEnv = e...
I try to use ImmutableEquivalenceSet, i found that `ImmutableEquivalenceSet` may be not suit the scene such as I want to make a relation mapping as `RelationId#1 -> RelationId#2` which should keep the directivity。 after call` ImmutableEquivalenceSet.addEqualPair` then `tryToMap`,i found get the result is > RelationI...
public static List<RelationMapping> generate(List<CatalogRelation> sources, List<CatalogRelation> targets) { HashMultimap<Long, MappedRelation> sourceTableRelationIdMap = HashMultimap.create(); for (CatalogRelation relation : sources) { sourceTableRelationIdMap.put(getTableQualifier...
List<List<RelationMapping>> mappedRelations = new ArrayList<>();
public static List<RelationMapping> generate(List<CatalogRelation> sources, List<CatalogRelation> targets) { HashMultimap<Long, MappedRelation> sourceTableRelationIdMap = HashMultimap.create(); for (CatalogRelation relation : sources) { sourceTableRelationIdMap.put(getTableQualifier...
class RelationMapping extends Mapping { private final ImmutableBiMap<MappedRelation, MappedRelation> mappedRelationMap; public RelationMapping(ImmutableBiMap<MappedRelation, MappedRelation> mappedRelationMap) { this.mappedRelationMap = mappedRelationMap; } public BiMap<MappedRelation, MappedR...
class RelationMapping extends Mapping { private final ImmutableBiMap<MappedRelation, MappedRelation> mappedRelationMap; public RelationMapping(ImmutableBiMap<MappedRelation, MappedRelation> mappedRelationMap) { this.mappedRelationMap = mappedRelationMap; } public BiMap<MappedRelation, MappedR...
I am not fully convinced this is the proper error handling logic to extract the http or grpc status code here. DatastoreException has an int getCode() this should return the http code which serviceCallMetri.call() will convert to a grpc status code. So lets's just change the logic to } catch (DatastoreException exc...
private void flushBatch() throws DatastoreException, IOException, InterruptedException { LOG.debug("Writing batch of {} mutations", mutations.size()); Sleeper sleeper = Sleeper.DEFAULT; BackOff backoff = BUNDLE_WRITE_BACKOFF.backoff(); while (true) { CommitRequest.Builder commi...
serviceCallMetric.call(errorInfo.getReason());
private void flushBatch() throws DatastoreException, IOException, InterruptedException { LOG.debug("Writing batch of {} mutations", mutations.size()); Sleeper sleeper = Sleeper.DEFAULT; BackOff backoff = BUNDLE_WRITE_BACKOFF.backoff(); while (true) { CommitRequest.Builder commi...
class DatastoreWriterFn extends DoFn<Mutation, Void> { private static final Logger LOG = LoggerFactory.getLogger(DatastoreWriterFn.class); private final ValueProvider<String> projectId; private final @Nullable String localhost; private transient Datastore datastore; private final V1DatastoreFactory...
class DatastoreWriterFn extends DoFn<Mutation, Void> { private static final Logger LOG = LoggerFactory.getLogger(DatastoreWriterFn.class); private final ValueProvider<String> projectId; private final @Nullable String localhost; private transient Datastore datastore; private final V1DatastoreFactory...
Let's also log other shutdown attempts as DEBUG.
private CompletableFuture<Void> close(Throwable cause) { final CompletableFuture<Void> shutdownFuture = new CompletableFuture<>(); if (connectionShutdownFuture.compareAndSet(null, shutdownFuture) && failureCause.compareAndSet(null, cause)) { channel.close().addListener(finished -> { stats.reportIn...
if (connectionShutdownFuture.compareAndSet(null, shutdownFuture) &&
private CompletableFuture<Void> close(Throwable cause) { CompletableFuture<Void> future = new CompletableFuture<>(); if (connectionShutdownFuture.compareAndSet(null, future)) { synchronized (connectLock) { if (failureCause == null) { failureCause = cause; } if (established != null) { ...
class PendingConnection implements ChannelFutureListener { /** Lock to guard the connect call, channel hand in, etc. */ private final Object connectLock = new Object(); /** Address of the server we are connecting to. */ private final InetSocketAddress serverAddress; private final MessageSerializer<REQ, RES...
class PendingConnection implements ChannelFutureListener { /** Lock to guard the connect call, channel hand in, etc. */ private final Object connectLock = new Object(); /** Address of the server we are connecting to. */ private final InetSocketAddress serverAddress; private final MessageSerializer<REQ, RES...
A question here: why have to change from `BufferOrEvent` to `Optional<BufferOrEvent>`, to avoid null check?
public Optional<BufferOrEvent> pollNext() throws Exception { while (true) { Optional<BufferOrEvent> next; if (currentBuffered == null) { next = inputGate.pollNext(); } else { next = Optional.ofNullable(currentBuffered.getNext()); if (!next.isPresent()) { completeBufferedSequence(...
if (currentBuffered == null) {
public Optional<BufferOrEvent> pollNext() throws Exception { while (true) { Optional<BufferOrEvent> next; if (currentBuffered == null) { next = inputGate.pollNext(); } else { next = Optional.ofNullable(currentBuffered.getNext()); if (!next.isPresent()) { completeBufferedSequence(...
class BarrierBuffer implements CheckpointBarrierHandler { private static final Logger LOG = LoggerFactory.getLogger(BarrierBuffer.class); /** The gate that the buffer draws its input from. */ private final InputGate inputGate; /** Flags that indicate whether a channel is currently blocked/buffered. */ private f...
class BarrierBuffer implements CheckpointBarrierHandler { private static final Logger LOG = LoggerFactory.getLogger(BarrierBuffer.class); /** The gate that the buffer draws its input from. */ private final InputGate inputGate; /** Flags that indicate whether a channel is currently blocked/buffered. */ private f...
fileSystem.listLocatedStatus is an api to list all statuses and block locations of the files in the given path in one operation. The performance is better than getting status and block location one by one.
private List<HdfsFileDesc> getHdfsFileDescs(String dirPath) throws Exception { URI uri = new URI(dirPath); FileSystem fileSystem = getFileSystem(uri); RemoteIterator<LocatedFileStatus> blockIterator = fileSystem.listLocatedStatus(new Path(uri.getPath())); List<...
private List<HdfsFileDesc> getHdfsFileDescs(String dirPath) throws Exception { URI uri = new URI(dirPath); FileSystem fileSystem = getFileSystem(uri); RemoteIterator<LocatedFileStatus> blockIterator = fileSystem.listLocatedStatus(new Path(uri.getPath())); List<...
class relies on opening if (Thread.currentThread().getContextClassLoader() == null) { Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader()); }
class relies on opening if (Thread.currentThread().getContextClassLoader() == null) { Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader()); }
This happens because the `stringValue()` method of the `io.ballerina.runtime.internal.values.FPValue` adds a `function` prefix, in https://github.com/ballerina-platform/ballerina-lang/blob/865850e24ff2882178085c7b0ed3948248e5df8c/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/FPValue.java#L86 ...
public void variableReferenceEvaluationTest() throws BallerinaTestException { debugTestRunner.assertExpression(context, NIL_VAR, "()", "nil"); debugTestRunner.assertExpression(context, BOOLEAN_VAR, "true", "boolean"); debugTestRunner.assertExpression(context, INT_VAR, ...
debugTestRunner.assertExpression(context, ANON_FUNCTION_VAR, "function isolated function (string,string) " +
public void variableReferenceEvaluationTest() throws BallerinaTestException { debugTestRunner.assertExpression(context, NIL_VAR, "()", "nil"); debugTestRunner.assertExpression(context, BOOLEAN_VAR, "true", "boolean"); debugTestRunner.assertExpression(context, INT_VAR, ...
class ExpressionEvaluationTest extends ExpressionEvaluationBaseTest { @BeforeClass(alwaysRun = true) public void setup() throws BallerinaTestException { prepareForEvaluation(); } @Override @Test public void literalEvaluationTest() throws BallerinaTestException { debugT...
class ExpressionEvaluationTest extends ExpressionEvaluationBaseTest { @BeforeClass(alwaysRun = true) public void setup() throws BallerinaTestException { prepareForEvaluation(); } @Override @Test public void literalEvaluationTest() throws BallerinaTestException { debugT...
Is it possible to merge this section with the `lookAheadForDocumentationReference` method? i.e: lookAheadForDocumentationReference will process all the tokens and returns the token, instead of the lookahead count
private STToken processQuotedIdentifier() { while (!reader.isEOF()) { int nextChar = reader.peek(); if (isIdentifierFollowingChar(nextChar)) { reader.advance(); continue; } if (nextChar != '\\') { break; ...
reader.advance(readerAdvanceCount);
private STToken processQuotedIdentifier() { while (!reader.isEOF()) { int nextChar = reader.peek(); if (isIdentifierFollowingChar(nextChar)) { reader.advance(); continue; } if (nextChar != '\\') { break; ...
class BallerinaLexer extends AbstractLexer { public BallerinaLexer(CharReader charReader) { super(charReader, ParserMode.DEFAULT); } /** * Get the next lexical token. * * @return Next lexical token. */ public STToken nextToken() { STToken token; switch (this...
class BallerinaLexer extends AbstractLexer { public BallerinaLexer(CharReader charReader) { super(charReader, ParserMode.DEFAULT); } /** * Get the next lexical token. * * @return Next lexical token. */ public STToken nextToken() { STToken token; switch (this...
> Previously desiredState = "FAILED" and newState = "CANCELLING" would return true. Now they return false. That's intended. As a side-effect it basically solves the failing cancel problem we've discussed previously. > How about, we use this: TBH I find these early returns super hard to read. Usually I'd try to avoid...
boolean updateTaskExecutionState(TaskExecutionStateTransition taskExecutionStateTransition) { if (taskExecutionStateTransition.getExecutionState() != ExecutionState.FAILED) { return getExecutionGraph().updateState(taskExecutionStateTransition); } ...
return true;
boolean updateTaskExecutionState(TaskExecutionStateTransition taskExecutionStateTransition) { final Optional<AccessExecution> maybeExecution = executionGraph.findExecution(taskExecutionStateTransition.getID()); final Optional<String> maybeTaskName = executionGrap...
class StateWithExecutionGraph implements State { private final Context context; private final ExecutionGraph executionGraph; private final ExecutionGraphHandler executionGraphHandler; private final OperatorCoordinatorHandler operatorCoordinatorHandler; private final KvStateHandler kvStateHandler...
class StateWithExecutionGraph implements State { private final Context context; private final ExecutionGraph executionGraph; private final ExecutionGraphHandler executionGraphHandler; private final OperatorCoordinatorHandler operatorCoordinatorHandler; private final KvStateHandler kvStateHandler...
adding @yrodiere for awareness and opinions as well..
public void testMetrics() { assertEquals(0L, getCounterValueOrNull("hibernate.query.executions", new Tag("entityManagerFactory", PersistenceUnitUtil.DEFAULT_PERSISTENCE_UNIT_NAME))); assertEquals(0L, getCounterValueOrNull("hibernate.entities.inserts", new Tag("entityManag...
assertEquals(0L, getCounterValueOrNull("hibernate.query.executions",
public void testMetrics() { assertEquals(0L, getCounterValueOrNull("hibernate.query.executions", new Tag("entityManagerFactory", PersistenceUnitUtil.DEFAULT_PERSISTENCE_UNIT_NAME))); assertEquals(0L, getCounterValueOrNull("hibernate.entities.inserts", new Tag("entityManag...
class DummyEntity { @Id private Long number; public Long getNumber() { return number; } public void setNumber(Long number) { this.number = number; } }
class DummyEntity { @Id private Long number; public Long getNumber() { return number; } public void setNumber(Long number) { this.number = number; } }
At present, we can't get `SessionVariable` from `HiveMetastore.java`, so session variable is not easy to be added. I add the variable in `Config.java` instead.
public HivePartitionStats getTableStatistics(String dbName, String tblName) { org.apache.hadoop.hive.metastore.api.Table table = client.getTable(dbName, tblName); HiveCommonStats commonStats = toHiveCommonStats(table.getParameters()); long totalRowNums = commonStats.getRowNums(); if (tot...
if (table.getParameters().keySet().stream().anyMatch(k -> k.startsWith("spark.sql.statistics.colStats."))) {
public HivePartitionStats getTableStatistics(String dbName, String tblName) { org.apache.hadoop.hive.metastore.api.Table table = client.getTable(dbName, tblName); HiveCommonStats commonStats = toHiveCommonStats(table.getParameters()); long totalRowNums = commonStats.getRowNums(); if (tot...
class HiveMetastore implements IHiveMetastore { private static final Logger LOG = LogManager.getLogger(CachingHiveMetastore.class); private final HiveMetaClient client; private final String catalogName; private final MetastoreType metastoreType; public HiveMetastore(HiveMetaClient client, String c...
class HiveMetastore implements IHiveMetastore { private static final Logger LOG = LogManager.getLogger(CachingHiveMetastore.class); private final HiveMetaClient client; private final String catalogName; private final MetastoreType metastoreType; public HiveMetastore(HiveMetaClient client, String c...
runningJobs is only used for replay, so no need to add a lock
public void cancelRunningJobs() { if (!GlobalStateMgr.isCheckpointThread()) { cancelJobExecutorService.submit(() -> { try { while (!GlobalStateMgr.getServingState().isReady()) { try { ...
if (runningJobs != null) {
public void cancelRunningJobs() { if (GlobalStateMgr.isCheckpointThread()) { return; } cancelJobExecutorService.submit(() -> { try { while (!GlobalStateMgr.getServingState().isReady()) { try { ...
class InsertOverwriteJobManager implements Writable, GsonPostProcessable { private static final Logger LOG = LogManager.getLogger(InsertOverwriteJobManager.class); @SerializedName(value = "overwriteJobMap") private Map<Long, InsertOverwriteJob> overwriteJobMap; @SerializedName(value = "partitions...
class InsertOverwriteJobManager implements Writable, GsonPostProcessable { private static final Logger LOG = LogManager.getLogger(InsertOverwriteJobManager.class); @SerializedName(value = "overwriteJobMap") private Map<Long, InsertOverwriteJob> overwriteJobMap; @SerializedName(value = "tableToOve...
By reading the spec, I can't really tell what the intended behavior is. I'll try and see if we can keep the paths of the original request and see how the tests behave
public Object extractParameter(ResteasyReactiveRequestContext context) { int index = findPathParamIndex(context.getLocatorTarget().getClassPath(), context.getLocatorTarget().getPath()); if (index >= 0) { return context.getLocatorPathParam(index); } return null; }
int index = findPathParamIndex(context.getLocatorTarget().getClassPath(), context.getLocatorTarget().getPath());
public Object extractParameter(ResteasyReactiveRequestContext context) { int index = findPathParamIndex(context.getLocatorTarget().getClassPath(), context.getLocatorTarget().getPath()); if (index >= 0) { return context.getLocatorPathParam(index); } return null; }
class LocatableResourcePathParamExtractor implements ParameterExtractor { private final String name; public LocatableResourcePathParamExtractor(String name) { this.name = name; } @Override private int findPathParamIndex(URITemplate classPathTemplate, URITemplate methodPathTemplate) ...
class LocatableResourcePathParamExtractor implements ParameterExtractor { private final String name; public LocatableResourcePathParamExtractor(String name) { this.name = name; } @Override private int findPathParamIndex(URITemplate classPathTemplate, URITemplate methodPathTemplate) ...
Yes, there is no case where mgr is null.
public long loadGlobalFunction(DataInputStream in, long checksum) throws IOException { GlobalFunctionMgr mgr = GlobalFunctionMgr.read(in); if (mgr != null) { this.globalFunctionMgr = mgr; } LOG.info("finished replay global function from image"); return checksum; }
if (mgr != null) {
public long loadGlobalFunction(DataInputStream in, long checksum) throws IOException { this.globalFunctionMgr = GlobalFunctionMgr.read(in); LOG.info("finished replay global function from image"); return checksum; }
class SingletonHolder { private static final Env INSTANCE = new Env(); }
class SingletonHolder { private static final Env INSTANCE = new Env(); }
These methods seem like they are both writing the bom file. #Resolved
public void generate() { TreeSet<BomDependency> inputDependencies = scan(); TreeSet<BomDependency> externalDependencies = resolveExternalDependencies(); DependencyAnalyzer analyzer = new DependencyAnalyzer(inputDependencies, externalDependencies); TreeSet<BomDependency...
TreeSet<BomDependency> inputDependencies = scan();
public void generate() { List<BomDependency> inputDependencies = scan(); List<BomDependency> externalDependencies = resolveExternalDependencies(); DependencyAnalyzer analyzer = new DependencyAnalyzer(inputDependencies, externalDependencies); analyzer.reduce(); ...
class BomGenerator { private String outputFileName; private String inputFileName; private String pomFileName; private String externalDependenciesFileName; private static Logger logger = LoggerFactory.getLogger(BomGenerator.class); BomGenerator() { } public void setInputFile(String inp...
class BomGenerator { private String outputFileName; private String inputFileName; private String pomFileName; private static Logger logger = LoggerFactory.getLogger(BomGenerator.class); BomGenerator(String inputFileName, String outputFileName, String pomFileName) { this.inputFileName = inp...
Do we have tests covering this? Is this only an issue with lambda functions?
private void checkArrayLibSortFuncArgs(BLangInvocation iExpr) { if (iExpr.argExprs.size() <= 2 && !types.isOrderedType(iExpr.argExprs.get(0).type)) { dlog.error(iExpr.argExprs.get(0).pos, DiagnosticCode.INVALID_SORT_ARRAY_MEMBER_TYPE, iExpr.argExprs.get(0).type); } ...
if (returnType.tag == TypeTags.SEMANTIC_ERROR) {
private void checkArrayLibSortFuncArgs(BLangInvocation iExpr) { if (iExpr.argExprs.size() <= 2 && !types.isOrderedType(iExpr.argExprs.get(0).type)) { dlog.error(iExpr.argExprs.get(0).pos, DiagnosticCode.INVALID_SORT_ARRAY_MEMBER_TYPE, iExpr.argExprs.get(0).type); } ...
class TypeChecker extends BLangNodeVisitor { private static final CompilerContext.Key<TypeChecker> TYPE_CHECKER_KEY = new CompilerContext.Key<>(); private static Set<String> listLengthModifierFunctions = new HashSet<>(); private static Map<String, HashSet<String>> modifierFunctions = new HashMap<>(); ...
class TypeChecker extends BLangNodeVisitor { private static final CompilerContext.Key<TypeChecker> TYPE_CHECKER_KEY = new CompilerContext.Key<>(); private static Set<String> listLengthModifierFunctions = new HashSet<>(); private static Map<String, HashSet<String>> modifierFunctions = new HashMap<>(); ...
I don't think they can? I think even before the migration there's always a default value?
public Read withAttemptTimeout(Duration timeout) { checkArgument(timeout.isLongerThan(Duration.ZERO), "attempt timeout must be positive"); BigtableReadOptions readOptions = getBigtableReadOptions(); return toBuilder() .setBigtableReadOptions(readOptions.toBuilder().setAttemptTimeout(timeout)...
checkArgument(timeout.isLongerThan(Duration.ZERO), "attempt timeout must be positive");
public Read withAttemptTimeout(Duration timeout) { checkArgument(timeout.isLongerThan(Duration.ZERO), "attempt timeout must be positive"); BigtableReadOptions readOptions = getBigtableReadOptions(); return toBuilder() .setBigtableReadOptions(readOptions.toBuilder().setAttemptTimeout(timeout)...
class to using the SegmentReader. If * null is passed, this behavior will be disabled and the stream reader will be used. * * <p>Does not modify this object. * * <p>When we have a builder, we initialize the value. When they call the method then we * override the value */ @Experime...
class to using the SegmentReader. If * null is passed, this behavior will be disabled and the stream reader will be used. * * <p>Does not modify this object. * * <p>When we have a builder, we initialize the value. When they call the method then we * override the value */ @Experime...
`verifyJobGraphs` verifies JobID and JobName, if we don't change both of them, we should remove such verification. Otherwise we' better to check update.
public void testPutAndRemoveJobGraph() throws Exception { ZooKeeperSubmittedJobGraphStore jobGraphs = createZooKeeperSubmittedJobGraphStore("/testPutAndRemoveJobGraph"); try { SubmittedJobGraphListener listener = mock(SubmittedJobGraphListener.class); jobGraphs.start(listener); SubmittedJobGraph jobGrap...
jobGraphs.putJobGraph(jobGraph);
public void testPutAndRemoveJobGraph() throws Exception { ZooKeeperSubmittedJobGraphStore jobGraphs = createZooKeeperSubmittedJobGraphStore("/testPutAndRemoveJobGraph"); try { SubmittedJobGraphListener listener = mock(SubmittedJobGraphListener.class); jobGraphs.start(listener); SubmittedJobGraph jobGrap...
class ZooKeeperSubmittedJobGraphsStoreITCase extends TestLogger { private static final ZooKeeperTestEnvironment ZooKeeper = new ZooKeeperTestEnvironment(1); private static final RetrievableStateStorageHelper<SubmittedJobGraph> localStateStorage = new RetrievableStateStorageHelper<SubmittedJobGraph>() { @Override ...
class ZooKeeperSubmittedJobGraphsStoreITCase extends TestLogger { private static final ZooKeeperTestEnvironment ZooKeeper = new ZooKeeperTestEnvironment(1); private static final RetrievableStateStorageHelper<SubmittedJobGraph> localStateStorage = new RetrievableStateStorageHelper<SubmittedJobGraph>() { @Override ...
add data for type: `TINYINT`, `SMALLINT` and `FLOAT`. Also please cover the slow path of some special handled data type, like `long`, `double`, `float`
public void testSerDe() throws Exception { long id = 1238123899121L; String name = "asdlkjasjkdla998y1122"; byte[] bytes = new byte[1024]; ThreadLocalRandom.current().nextBytes(bytes); BigDecimal decimal = new BigDecimal("123.456789"); Double[] doubles = new Double[]{1.1, 2.2, 3.3}; LocalDate date = Local...
long id = 1238123899121L;
public void testSerDe() throws Exception { byte tinyint = 'c'; short smallint = 128; int intValue = 45536; float floatValue = 33.333F; long bigint = 1238123899121L; String name = "asdlkjasjkdla998y1122"; byte[] bytes = new byte[1024]; ThreadLocalRandom.current().nextBytes(bytes); BigDecimal decimal = ...
class JsonRowDataSerDeSchemaTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Test @Test public void testSerDeMultiRows() throws Exception { RowType rowType = (RowType) ROW( FIELD("f1", INT()), FIELD("f2", BOOLEAN()), FIELD("f3", STRING()) ).getLogicalType(); JsonRowDat...
class JsonRowDataSerDeSchemaTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Test /** * Tests the deserialization slow path, * e.g. convert into string and use {@link Double */ @Test public void testSlowDeserialization() throws Exception { Random random = new Random(); bool...
Can't/shouldn't we call `analyzeNode` instead of directly calling `accept`?
public void visit(BLangMappingMatchPattern mappingMatchPattern) { BRecordTypeSymbol recordSymbol = Symbols.createRecordSymbol(0, names.fromString("$anonRecordType$" + recordCount++), env.enclPkg.symbol.pkgID, null, env.scope.owner, mappingMatchPattern.pos, VIRTUAL); ...
fieldMatchPattern.accept(this);
public void visit(BLangMappingMatchPattern mappingMatchPattern) { EnumSet<Flag> flags = EnumSet.of(Flag.PUBLIC, Flag.ANONYMOUS); BRecordTypeSymbol recordSymbol = Symbols.createRecordSymbol(Flags.asMask(flags), Names.EMPTY, env.enclPkg.packageID, null, env.scope.owner, mappingMatchPattern...
class SemanticAnalyzer extends BLangNodeVisitor { private static final CompilerContext.Key<SemanticAnalyzer> SYMBOL_ANALYZER_KEY = new CompilerContext.Key<>(); private static final String ANONYMOUS_RECORD_NAME = "anonymous-record"; private static final String NULL_LITERAL = "null"; private ...
class defined for an object-constructor-expression (OCE). This will be analyzed when continue; } analyzeDef((BLangNode) pkgLevelNode, pkgEnv); } while (pkgNode.lambdaFunctions.peek() != null) { BLang...
The direct mode will also use the proxy configuration which is from the gateconnection configuration, then the gateconnection will have the high priority to apply.
protected void configureService(CosmosClientBuilder builder) { PropertyMapper map = new PropertyMapper(); map.from(this.cosmosProperties.getEndpoint()).to(builder::endpoint); map.from(this.cosmosProperties.getConsistencyLevel()).to(builder::consistencyLevel); map.from(this.cosmosPropert...
builder.gatewayMode(this.cosmosProperties.getGatewayConnection());
protected void configureService(CosmosClientBuilder builder) { PropertyMapper map = new PropertyMapper(); map.from(this.cosmosProperties.getEndpoint()).to(builder::endpoint); map.from(this.cosmosProperties.getConsistencyLevel()).to(builder::consistencyLevel); map.from(this.cosmosPropert...
class CosmosClientBuilderFactory extends AbstractAzureServiceClientBuilderFactory<CosmosClientBuilder> { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosClientBuilderFactory.class); private final CosmosProperties cosmosProperties; public CosmosClientBuilderFactory(CosmosProperties cosm...
class CosmosClientBuilderFactory extends AbstractAzureServiceClientBuilderFactory<CosmosClientBuilder> { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosClientBuilderFactory.class); private final CosmosProperties cosmosProperties; public CosmosClientBuilderFactory(CosmosProperties cosm...
Can be merged with the previous line.
public void testEncryptRsaEcbOAEPwithSHA512andMGF1() { byte[] message = "Ballerina crypto test ".getBytes(StandardCharsets.UTF_8); BValueArray messageValue = new BValueArray(message); BValue[] args = {messageValue, new BString(confRoot.resolve("testKeystore.p12").toString()), ...
new BString("OAEPwithSHA512andMGF1")};
public void testEncryptRsaEcbOAEPwithSHA512andMGF1() { byte[] message = "Ballerina crypto test ".getBytes(StandardCharsets.UTF_8); BValueArray messageValue = new BValueArray(message); BValue[] args = {messageValue, new BString(confRoot.resolve("testKeystore.p12").toString()), ...
class CryptoTest { private static final int KEY_SIZE = 16; private CompileResult compileResult; private String resourceRoot; private Path sourceRoot; private Path confRoot; @BeforeClass public void setup() { resourceRoot = Paths.get("src", "test", "resources").toAbsolutePath().to...
class CryptoTest { private static final int KEY_SIZE = 16; private CompileResult compileResult; private String resourceRoot; private Path sourceRoot; private Path confRoot; @BeforeClass public void setup() { resourceRoot = Paths.get("src", "test", "resources").toAbsolutePath().to...
+1. We can remove that variable.
private boolean checkUnionHasSameType(BUnionType unionType, BType baseType) { LinkedHashSet<BType> memberTypes = unionType.getMemberTypes(); boolean hasSameOrderedType = false; for (BType type : memberTypes) { type = getReferredType(type); if (type.tag == TypeTags.FINITE)...
boolean hasSameOrderedType = false;
private boolean checkUnionHasSameType(BUnionType unionType, BType baseType) { LinkedHashSet<BType> memberTypes = unionType.getMemberTypes(); for (BType type : memberTypes) { type = getReferredType(type); if (type.tag == TypeTags.FINITE) { for (BLangExpression expr...
class BOrderedTypeVisitor implements BTypeVisitor<BType, Boolean> { Set<TypePair> unresolvedTypes; BOrderedTypeVisitor(Set<TypePair> unresolvedTypes) { this.unresolvedTypes = unresolvedTypes; } @Override public Boolean visit(BType target, BType source) { ...
class BOrderedTypeVisitor implements BTypeVisitor<BType, Boolean> { Set<TypePair> unresolvedTypes; BOrderedTypeVisitor(Set<TypePair> unresolvedTypes) { this.unresolvedTypes = unresolvedTypes; } @Override public Boolean visit(BType target, BType source) { ...
Done, though the purpose of this empty line was to separate the "given" from the "when" in the test
void assertReviserReturnsRevisedIndex() { IndexMetaData originalMetaData = new IndexMetaData("test_idx_tableName"); originalMetaData.getColumns().add("column1"); originalMetaData.getColumns().add("column2"); originalMetaData.setUnique(true); SingleIndexReviser reviser = new Singl...
void assertReviserReturnsRevisedIndex() { IndexMetaData originalMetaData = new IndexMetaData("test_idx_tableName"); originalMetaData.getColumns().add("column1"); originalMetaData.getColumns().add("column2"); originalMetaData.setUnique(true); SingleIndexReviser reviser = new Singl...
class SingleIndexReviserTest { @Test }
class SingleIndexReviserTest { @Test }
add endpoint or region check, either should be non-empty but not both empty.
public void validateStorageVolumeConfig() throws InvalidConfException { switch (Config.cloud_native_storage_type.toLowerCase()) { case "s3": String[] bucketAndPrefix = getBucketAndPrefix(); String bucket = bucketAndPrefix[0]; if (bucket.isEmpty()) { ...
case "hdfs":
public void validateStorageVolumeConfig() throws InvalidConfException { switch (Config.cloud_native_storage_type.toLowerCase()) { case "s3": String[] bucketAndPrefix = getBucketAndPrefix(); String bucket = bucketAndPrefix[0]; if (bucket.isEmpty()) { ...
class SharedDataStorageVolumeMgr extends StorageVolumeMgr { @Override public StorageVolume getStorageVolumeByName(String svName) { try (LockCloseable lock = new LockCloseable(rwLock.readLock())) { try { FileStoreInfo fileStoreInfo = GlobalStateMgr.getCurrentState().getStarOSA...
class SharedDataStorageVolumeMgr extends StorageVolumeMgr { @Override public StorageVolume getStorageVolumeByName(String svName) { try (LockCloseable lock = new LockCloseable(rwLock.readLock())) { try { FileStoreInfo fileStoreInfo = GlobalStateMgr.getCurrentState().getStarOSA...
Wondering if we should make things a bit more complex. E.g. either the package should be `my.package` or it should start with `my.package.` (with a final dot). I don't think we want to catch `my.package2` and if I'm not mistaken, we catch it with what you did.
private List<Predicate<String>> initPredicates(Collection<String> exclusions) { final String packMatch = ".*"; List<Predicate<String>> predicates = new ArrayList<>(); for (String exclusionExpression : exclusions) { if (exclusionExpression.endsWith(packMatch)) { ...
final String pack = exclusionExpression.substring(0, exclusionExpression.length() - packMatch.length());
Override public boolean test(String packageName) { return packageName.equals(pack) || packageName.startsWith(pack + "."); }
class in each archive for (ClassInfo classInfo : archive.getIndex().getKnownClasses()) { String packageName = DotNames.packageName(classInfo.name()); packageToArchiveMap.compute(packageName, (key, val) -> { Set<ApplicationArchive> returnValue = val == null...
class in each archive for (ClassInfo classInfo : archive.getIndex().getKnownClasses()) { String packageName = DotNames.packageName(classInfo.name()); packageToArchiveMap.compute(packageName, (key, val) -> { Set<ApplicationArchive> returnValue = val == null...
It is required since when we run the non native image (standard java jar) we do not want the TSM to be started.
public void configureRuntimeProperties(NarayanaSTMRecorder recorder) { recorder.disableTransactionStatusManager(); }
recorder.disableTransactionStatusManager();
public void configureRuntimeProperties(NarayanaSTMRecorder recorder) { recorder.disableTransactionStatusManager(); }
class NarayanaSTMProcessor { private static final Logger log = Logger.getLogger(NarayanaSTMProcessor.class.getName()); @Inject CombinedIndexBuildItem combinedIndexBuildItem; @Inject BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass; @Inject BuildProducer<ReflectiveClass...
class NarayanaSTMProcessor { private static final Logger log = Logger.getLogger(NarayanaSTMProcessor.class.getName()); @Inject CombinedIndexBuildItem combinedIndexBuildItem; @Inject BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass; @Inject BuildProducer<ReflectiveClass...
```suggestion String.format("The jni reader fields' size {%s} is not matched with paimon fields' size {%s}. Please refresh table and try again", ```
private void initReader() throws IOException { ReadBuilder readBuilder = table.newReadBuilder(); if (this.fields.length != this.paimonAllFieldNames.size()) { throw new IOException( String.format("The jni reader fields' size {%s} is not matched with paimon fields' size {%s...
String.format("The jni reader fields' size {%s} is not matched with paimon fields' size {%s}",
private void initReader() throws IOException { ReadBuilder readBuilder = table.newReadBuilder(); if (this.fields.length != this.paimonAllFieldNames.size()) { throw new IOException( String.format( "The jni reader fields' size {%s} is not matched...
class PaimonJniScanner extends JniScanner { private static final Logger LOG = LoggerFactory.getLogger(PaimonJniScanner.class); private static final String PAIMON_OPTION_PREFIX = "paimon_option_prefix."; private final Map<String, String> params; private final Map<String, String> paimonOptionParams; p...
class PaimonJniScanner extends JniScanner { private static final Logger LOG = LoggerFactory.getLogger(PaimonJniScanner.class); private static final String PAIMON_OPTION_PREFIX = "paimon_option_prefix."; private final Map<String, String> params; private final Map<String, String> paimonOptionParams; p...
No, it's just important to not accept all exceptions. Otherwise the AssertionError thrown by `snsWriterFnLogs.verifyWarn` fullfills this, which is kind of pointless. But that's exactly what happened, because logs for the wrong logger were captured. Even more, the message of the assertion error contained exactly that s...
public void testRetries() throws Throwable { thrown.expect(IOException.class); thrown.expectMessage("Error writing to SNS"); thrown.expectMessage("No more attempts allowed"); final PublishRequest request1 = createSampleMessage("my message that will not be published"); final TupleTag<PublishResult> ...
thrown.expect(IOException.class);
public void testRetries() throws Throwable { thrown.expect(IOException.class); thrown.expectMessage("Error writing to SNS"); thrown.expectMessage("No more attempts allowed"); final PublishRequest request1 = createSampleMessage("my message that will not be published"); final TupleTag<PublishResult> ...
class Provider implements AwsClientsProvider { private static AmazonSNS publisher; public Provider(AmazonSNS pub) { publisher = pub; } @Override public AmazonCloudWatch getCloudWatchClient() { return Mockito.mock(AmazonCloudWatch.class); } @Override public AmazonSNS creat...
class Provider implements AwsClientsProvider { private static AmazonSNS publisher; public Provider(AmazonSNS pub) { publisher = pub; } @Override public AmazonCloudWatch getCloudWatchClient() { return Mockito.mock(AmazonCloudWatch.class); } @Override public AmazonSNS creat...
Can you add some comment highlighting and justifying that you are iterating here over all of the state handles?
public String toString() { synchronized (registeredStates) { return "SharedStateRegistry{" + "registeredStates=" + registeredStates + '}'; } }
synchronized (registeredStates) {
public String toString() { synchronized (registeredStates) { return "SharedStateRegistry{" + "registeredStates=" + registeredStates + '}'; } }
class SharedStateRegistryImpl implements SharedStateRegistry { private static final Logger LOG = LoggerFactory.getLogger(SharedStateRegistryImpl.class); /** All registered state objects by an artificial key */ private final Map<SharedStateRegistryKey, SharedStateEntry> registeredStates; /** This flag...
class SharedStateRegistryImpl implements SharedStateRegistry { private static final Logger LOG = LoggerFactory.getLogger(SharedStateRegistryImpl.class); /** All registered state objects by an artificial key */ private final Map<SharedStateRegistryKey, SharedStateEntry> registeredStates; /** This flag...
Shall we add tests for the not-covered cases?
private boolean isOverridden(Method method1, Method method2, Class<?> clazz) { if ((Modifier.isStatic(method1.getModifiers()) ^ Modifier.isStatic(method2.getModifiers())) || method1.getParameterCount() != method2.getParameterCount()) { ...
return false;
private boolean isOverridden(Method method1, Method method2, Class<?> clazz) { if (method1.getParameterCount() != method2.getParameterCount()) { throw new JInteropException(OVERLOADED_METHODS, "Overloaded methods cannot be differentiated. " + ...
class names for each parameter " + "with 'paramTypes' field in the annotation"); } } JMethod jMethod = resolveExactMethod(jMethodRequest.declaringClass, jMethodRequest.methodName, jMethodRequest.kind, jMethodRequest.paramTypeConstraints, jMeth...
class '" + jMethodRequest.declaringClass.getName() + "'"); } } jMethods = resolveByParamCount(jMethods, jMethodRequest); if (jMethods.isEmpty()) { throwMethodNotFoundError(jMethodRequest); }
Shall we add the test function name too here, so that it's easier to identify the exact error?
private static void resolveFunctions(TestSuite suite) { List<TesterinaFunction> functions = suite.getTestUtilityFunctions(); List<String> functionNames = functions.stream().map(testerinaFunction -> testerinaFunction.getName()).collect (Collectors.toList()); for (Test test : suite...
throw new BallerinaException("Cannot find the specified dependsOn function : " + dependsOnFn);
private static void resolveFunctions(TestSuite suite) { List<TesterinaFunction> functions = suite.getTestUtilityFunctions(); List<String> functionNames = functions.stream().map(testerinaFunction -> testerinaFunction.getName()).collect (Collectors.toList()); for (Test test : suite...
class TestAnnotationProcessor extends AbstractCompilerPlugin { private static final String TEST_ANNOTATION_NAME = "Config"; private static final String BEFORE_SUITE_ANNOTATION_NAME = "BeforeSuite"; private static final String AFTER_SUITE_ANNOTATION_NAME = "AfterSuite"; private static final String BEFORE...
class TestAnnotationProcessor extends AbstractCompilerPlugin { private static final String TEST_ANNOTATION_NAME = "Config"; private static final String BEFORE_SUITE_ANNOTATION_NAME = "BeforeSuite"; private static final String AFTER_SUITE_ANNOTATION_NAME = "AfterSuite"; private static final String BEFORE...
To be clear all versions in a detail object will be of the same type. The Vault API will not allow mixing asymmetric and symmetric key versions. So, with your suggestion, you'd have two separate maps of versions and one would always be empty. You'd have to check the size of the maps to see which one is not empty and us...
public void symmetricReadAESKey() { assertFalse(transitSecretEngine.listKeys().contains(KEY_NAME)); transitSecretEngine.createKey(KEY_NAME, new KeyCreationRequestDetail().setType("aes256-gcm96")); assertTrue(transitSecretEngine.listKeys().contains(KEY_NAME)); VaultTransitKeyDetail myke...
assertEquals(mykey.getType(), "aes256-gcm96");
public void symmetricReadAESKey() { assertFalse(transitSecretEngine.listKeys().contains(KEY_NAME)); transitSecretEngine.createKey(KEY_NAME, new KeyCreationRequestDetail().setType("aes256-gcm96")); assertTrue(transitSecretEngine.listKeys().contains(KEY_NAME)); VaultTransitKeyDetail<?> m...
class VaultTransitITCase { private static final Logger log = Logger.getLogger(VaultTransitITCase.class); public static final String COUCOU = "coucou"; public static final String NEW_KEY = "new-key"; @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArc...
class VaultTransitITCase { private static final Logger log = Logger.getLogger(VaultTransitITCase.class); public static final String COUCOU = "coucou"; public static final String NEW_KEY = "new-key"; @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArc...
based on our discussion converting all the exception to SBRE .
private Throwable mapError(Throwable throwable, ServiceBusErrorSource errorSource) { if (!(throwable instanceof AmqpException) && !(throwable instanceof ServiceBusReceiverException)) { return new ServiceBusReceiverException(throwable, errorSource); } return throwable; }
if (!(throwable instanceof AmqpException) && !(throwable instanceof ServiceBusReceiverException)) {
private Throwable mapError(Throwable throwable, ServiceBusErrorSource errorSource) { if (!(throwable instanceof ServiceBusReceiverException)) { return new ServiceBusReceiverException(throwable, errorSource); } return throwable; }
class ServiceBusReceiverAsyncClient implements AutoCloseable { private static final DeadLetterOptions DEFAULT_DEAD_LETTER_OPTIONS = new DeadLetterOptions(); private static final String TRANSACTION_LINK_NAME = "coordinator"; private final LockContainer<LockRenewalOperation> renewalContainer; private fin...
class ServiceBusReceiverAsyncClient implements AutoCloseable { private static final DeadLetterOptions DEFAULT_DEAD_LETTER_OPTIONS = new DeadLetterOptions(); private static final String TRANSACTION_LINK_NAME = "coordinator"; private final LockContainer<LockRenewalOperation> renewalContainer; private fin...
Instead of having `flux` and `iterable` fields in this class, if an instance of IterableStream is created using an iterable, can this just be converted to `this.flux = Flux.fromIterable(Objects.requireNonNull(iterable, "'iterable' cannot be null."));`. Simplifies code in other methods too where you don't have to check ...
public IterableStream(Iterable<T> iterable) { this.iterable = Objects.requireNonNull(iterable, "'iterable' cannot be null."); this.flux = null; }
this.iterable = Objects.requireNonNull(iterable, "'iterable' cannot be null.");
public IterableStream(Iterable<T> iterable) { this.iterable = Objects.requireNonNull(iterable, "'iterable' cannot be null."); this.flux = null; }
class IterableStream<T> implements Iterable<T> { private final ClientLogger logger = new ClientLogger(IterableStream.class); private final Flux<T> flux; private final Iterable<T> iterable; /** * Creates an instance with the given {@link Flux}. * * @param flux Flux of items to iterate ove...
class IterableStream<T> implements Iterable<T> { private final ClientLogger logger = new ClientLogger(IterableStream.class); private final Flux<T> flux; private final Iterable<T> iterable; /** * Creates an instance with the given {@link Flux}. * * @param flux Flux of items to iterate ove...
Thanks. Method `isShadow()` in the algorithm is used to determine whether the sql contains shadow coloring. Shadow tables and shadow algorithms are separately configured and referenced by ID. If the user customizes the algorithm, he needs to get the configured shadow tables to customize his own judgment algorithm. S...
public boolean isShadow(final Collection<String> shadowTableNames, final PreciseColumnShadowValue<Comparable<?>> shadowValue) { boolean containTable = shadowTableNames.contains(shadowValue.getLogicTableName()); boolean isSameOperation = shadowOperationType == shadowValue.getShadowOperationType(); ...
boolean containTable = shadowTableNames.contains(shadowValue.getLogicTableName());
public boolean isShadow(final Collection<String> shadowTableNames, final PreciseColumnShadowValue<Comparable<?>> shadowValue) { boolean containTable = shadowTableNames.contains(shadowValue.getLogicTableName()); boolean isSameOperation = shadowOperationType == shadowValue.getShadowOperationType(); ...
class ColumnRegexMatchShadowAlgorithm implements ColumnShadowAlgorithm<Comparable<?>> { private static final String COLUMN = "column"; private static final String OPERATION = "operation"; private static final String REGEX = "regex"; private Properties props = new Properties(); ...
class ColumnRegexMatchShadowAlgorithm implements ColumnShadowAlgorithm<Comparable<?>> { private static final String COLUMN = "column"; private static final String OPERATION = "operation"; private static final String REGEX = "regex"; private Properties props = new Properties(); ...
The `count != 0` is not under the lock
public void awaitZero() throws InterruptedException { if (count != 0) { latch.await(); } }
if (count != 0) {
public void awaitZero() throws InterruptedException { sync.acquireSharedInterruptibly(1); }
class CountingLatch { private int count; private final Lock lock = new ReentrantLock(); private final CountDownLatch latch; public CountingLatch(int initialValue) { this.count = initialValue; this.latch = new CountDownLatch(1); } public void increment() { lock.lock(); ...
class Sync extends AbstractQueuedSynchronizer { private Sync() { } private Sync(final int initialState) { setState(initialState); } int getCount() { return getState(); } protected int tryAcquireShared(final int acquires) { re...
I agree with the change but I think the comment should be: ```suggestion //We must not ignore the returned CompletionStage! ```
public void disposeStageSession(@Disposes Stage.Session reactiveSession) { if (reactiveSession != null) { reactiveSession.close().toCompletableFuture().join(); } }
public void disposeStageSession(@Disposes Stage.Session reactiveSession) { if (reactiveSession != null) { reactiveSession.close().toCompletableFuture().join(); } }
class ReactiveSessionProducer { @Inject Stage.SessionFactory reactiveSessionFactory; @Inject Mutiny.SessionFactory mutinySessionFactory; @Produces @RequestScoped @DefaultBean public Stage.Session createStageSession() { return reactiveSessionFactory.openSession(); } @P...
class ReactiveSessionProducer { @Inject Stage.SessionFactory reactiveSessionFactory; @Inject Mutiny.SessionFactory mutinySessionFactory; @Produces @RequestScoped @DefaultBean public Stage.Session createStageSession() { return reactiveSessionFactory.openSession(); } @P...
Could you also add some comments after the `SET`? Because it fails to parse the statement when comment is around SQL Client commands.
public void testInitFile() throws Exception { List<String> statements = Arrays.asList( "-- Define Table \n" + "CREATE TABLE source (" + "id INT," + "val STRING" ...
"SET key = value;\n");
public void testInitFile() throws Exception { List<String> statements = Arrays.asList( "-- define table \n" + "CREATE TABLE source (" + "id INT," + "val STRING" ...
class SqlClientTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); private Map<String, String> originalEnv; private String historyPath; @Rule public Timeout timeout = new Timeout(1000, TimeUnit.SECONDS); ...
class SqlClientTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); private Map<String, String> originalEnv; private String historyPath; @Rule public Timeout timeout = new Timeout(1000, TimeUnit.SECONDS); ...
These code snippets would need a valid `jsonWebKeyToImport` to work. @g2vinay do we have a good working example for this or should we just keep these in the code files for now?
public void createKey() { KeyClient keyClient = createClient(); Key key = keyClient.createKey("keyName", KeyType.EC); System.out.printf("Key is created with name %s and id %s %n", key.name(), key.id()); KeyCreateOptions keyCreateOptions = new KeyCreateOptions(...
public void createKey() { KeyClient keyClient = createClient(); Key key = keyClient.createKey("keyName", KeyType.EC); System.out.printf("Key is created with name %s and id %s %n", key.name(), key.id()); KeyCreateOptions keyCreateOptions = new KeyCreateOptions(...
class KeyClientJavaDocCodeSnippets { private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Generates code sample for creating a {@link KeyAsyncClient} * @return An instance of {@link KeyAsyncClient} */ p...
class KeyClientJavaDocCodeSnippets { private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Generates code sample for creating a {@link KeyClient} * @return An instance of {@link KeyClient} */ public KeyC...
Does base class method call need to be "synchronized"/single threaded as well?
public void populatePropertyBag() { super.populatePropertyBag(); synchronized(this) { setProperty( this, Constants.Properties.CHANGE_FEED_START_FROM_TYPE, ChangeFeedStartFromTypes.NOW); } }
super.populatePropertyBag();
public void populatePropertyBag() { super.populatePropertyBag(); synchronized(this) { setProperty( this, Constants.Properties.CHANGE_FEED_START_FROM_TYPE, ChangeFeedStartFromTypes.NOW); } }
class ChangeFeedStartFromNowImpl extends ChangeFeedStartFromInternal { public ChangeFeedStartFromNowImpl() { super(); } @Override @Override public boolean supportsFullFidelityRetention() { return true; } @Override public void populateRequest(RxDocumentServiceReque...
class ChangeFeedStartFromNowImpl extends ChangeFeedStartFromInternal { public ChangeFeedStartFromNowImpl() { super(); } @Override @Override public boolean supportsFullFidelityRetention() { return true; } @Override public void populateRequest(RxDocumentServiceReque...
except sort node, all other node should use same logical to do limit merge, right?
public PlanFragment visitPhysicalLimit(PhysicalLimit<Plan> physicalLimit, PlanTranslatorContext context) { PlanFragment inputFragment = physicalLimit.child(0).accept(this, context); PlanNode child = inputFragment.getPlanRoot(); if (child instanceof OlapScanNode) { child.setLimit(phys...
if (child instanceof AggregationNode) {
public PlanFragment visitPhysicalLimit(PhysicalLimit<Plan> physicalLimit, PlanTranslatorContext context) { PlanFragment inputFragment = physicalLimit.child(0).accept(this, context); PlanNode child = inputFragment.getPlanRoot(); if (child instanceof SortNode) ...
class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, PlanTranslatorContext> { /** * The left and right child of origin predicates need to be swap sometimes. * Case A: * select * from t1 join t2 on t2.id=t1.id * The left plan node is t1 and the right plan node is t2. * The l...
class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, PlanTranslatorContext> { /** * The left and right child of origin predicates need to be swap sometimes. * Case A: * select * from t1 join t2 on t2.id=t1.id * The left plan node is t1 and the right plan node is t2. * The l...
Use () -> new RuntimeException(...). The reason is that your approach captures the stack trace at assembly time, not really useful.
public Iterable<ConfigSource> getConfigSources(ClassLoader cl) { Map<String, ValueType> keys = config.keysAsMap(); if (keys.isEmpty()) { log.debug("No keys were configured for config source lookup"); return Collections.emptyList(); } List<ConfigSource> result = n...
return Uni.createFrom().failure(new RuntimeException(message));
public Iterable<ConfigSource> getConfigSources(ClassLoader cl) { Map<String, ValueType> keys = config.keysAsMap(); if (keys.isEmpty()) { log.debug("No keys were configured for config source lookup"); return Collections.emptyList(); } List<ConfigSource> result = n...
class ConsulConfigSourceProvider implements ConfigSourceProvider { private static final Logger log = Logger.getLogger(ConsulConfigSourceProvider.class); private final ConsulConfig config; private final ConsulConfigGateway consulConfigGateway; private final ResponseConfigSourceUtil responseConfigSourc...
class ConsulConfigSourceProvider implements ConfigSourceProvider { private static final Logger log = Logger.getLogger(ConsulConfigSourceProvider.class); private final ConsulConfig config; private final ConsulConfigGateway consulConfigGateway; private final ResponseConfigSourceUtil responseConfigSourc...
but the user can only pass binaryData, right? so it is already serialized.
public CloudEvent(String source, String type, BinaryData data, CloudEventDataFormat format, String dataContentType) { if (Objects.isNull(source)) { throw LOGGER.logExceptionAsError(new NullPointerException("'source' cannot be null.")); } if (Objects.isNull(type)) { throw ...
this.data = data.toString();
public CloudEvent(String source, String type, BinaryData data, CloudEventDataFormat format, String dataContentType) { Objects.requireNonNull(source, "'source' cannot be null."); Objects.requireNonNull(type, "'type' cannot be null."); this.source = source; this.type = type; if (da...
class CloudEvent { private static final String SPEC_VERSION = "1.0"; private static final JsonSerializer SERIALIZER; static { JsonSerializer tmp; try { tmp = JsonSerializerProviders.createInstance(); } catch (IllegalStateException e) { tmp = new JacksonSerial...
class accepts any String for compatibility with legacy systems. * @param type Type of event related to the originating occurrence. * @param data A {@link BinaryData}
Can you align the output with the above lines?
public void execute() { BuildWorkerParams params = getParameters(); Properties props = buildSystemProperties(); ResolvedDependency appArtifact = params.getAppModel().get().getAppArtifact(); String gav = appArtifact.getGroupId() + ":" + appArtifact.getArtifactId() + ":" + appArtifact.get...
LOGGER.info(" Gradle version: {}", params.getGradleVersion().get());
public void execute() { BuildWorkerParams params = getParameters(); Properties props = buildSystemProperties(); ResolvedDependency appArtifact = params.getAppModel().get().getAppArtifact(); String gav = appArtifact.getGroupId() + ":" + appArtifact.getArtifactId() + ":" + appArtifact.get...
class BuildWorker extends QuarkusWorker<BuildWorkerParams> { private static final Logger LOGGER = LoggerFactory.getLogger(BuildWorker.class); @Override private static class Log4JMessageWriter implements MessageWriter { private final Logger LOGGER; public Log4JMessageWriter(final Logg...
class BuildWorker extends QuarkusWorker<BuildWorkerParams> { private static final Logger LOGGER = LoggerFactory.getLogger(BuildWorker.class); @Override private static class Slf4JMessageWriter implements MessageWriter { private final Logger LOGGER; public Slf4JMessageWriter(final Logg...
`BuildContext` could only be null in tests. ISE is fine.
public Collection<AnnotationInstance> getAllAnnotations() { if (annotationStore == null) { throw new IllegalStateException( "Attempted to use TransformationContext } return annotationStore.getAnnotations(getTarget()); }
return annotationStore.getAnnotations(getTarget());
public Collection<AnnotationInstance> getAllAnnotations() { if (annotationStore == null) { throw new IllegalStateException( "Attempted to use TransformationContext } return annotationStore.getAnnotations(getTarget()); }
class TransformationContextImpl implements InjectionPointsTransformer.TransformationContext { private AnnotationTarget target; private Set<AnnotationInstance> qualifiers; private AnnotationStore annotationStore; TransformationContextImpl(AnnotationTarget target, Set<AnnotationInstance>...
class TransformationContextImpl implements InjectionPointsTransformer.TransformationContext { private AnnotationTarget target; private Set<AnnotationInstance> qualifiers; private AnnotationStore annotationStore; TransformationContextImpl(AnnotationTarget target, Set<AnnotationInstance>...
We should use logger.error here, and everywhere else in the tests.
public void staledLeaseAcquiring() { final String ownerFirst = "Owner_First"; final String ownerSecond = "Owner_Second"; final String leasePrefix = "TEST"; ChangeFeedProcessor changeFeedProcessorFirst = ChangeFeedProcessor.Builder() .hostName(ownerFirst) .handleC...
e.printStackTrace();
public void staledLeaseAcquiring() { final String ownerFirst = "Owner_First"; final String ownerSecond = "Owner_Second"; final String leasePrefix = "TEST"; ChangeFeedProcessor changeFeedProcessorFirst = ChangeFeedProcessor.Builder() .hostName(ownerFirst) .handleC...
class ChangeFeedProcessorTest extends TestSuiteBase { private final static Logger log = LoggerFactory.getLogger(ChangeFeedProcessorTest.class); private CosmosDatabase createdDatabase; private CosmosContainer createdFeedCollection; private CosmosContainer createdLeaseCollection; private List<CosmosI...
class ChangeFeedProcessorTest extends TestSuiteBase { private final static Logger log = LoggerFactory.getLogger(ChangeFeedProcessorTest.class); private CosmosDatabase createdDatabase; private CosmosContainer createdFeedCollection; private CosmosContainer createdLeaseCollection; private List<CosmosI...
It's better put after `getAuthority`
public void assertLoadEmptyConfiguration() throws IOException { YamlProxyConfiguration actual = ProxyConfigurationLoader.load("/conf/empty/"); YamlProxyServerConfiguration serverConfig = actual.getServerConfiguration(); assertNull(serverConfig.getMode()); assertNull(serverConfig.getAutho...
assertNull(serverConfig.getCdc());
public void assertLoadEmptyConfiguration() throws IOException { YamlProxyConfiguration actual = ProxyConfigurationLoader.load("/conf/empty/"); YamlProxyServerConfiguration serverConfig = actual.getServerConfiguration(); assertNull(serverConfig.getMode()); assertNull(serverConfig.getAutho...
class ProxyConfigurationLoaderTest { @Test @Test public void assertLoad() throws IOException { YamlProxyConfiguration actual = ProxyConfigurationLoader.load("/conf/config_loader/"); Iterator<YamlRuleConfiguration> actualGlobalRules = actual.getServerConfiguration().getRules()....
class ProxyConfigurationLoaderTest { @Test @Test public void assertLoad() throws IOException { YamlProxyConfiguration actual = ProxyConfigurationLoader.load("/conf/config_loader/"); Iterator<YamlRuleConfiguration> actualGlobalRules = actual.getServerConfiguration().getRules()....
I think there was a typo here maybe this should have been: ``` if (instance.name().equals(MOCKITO_CONFIG) && instance.target().asField().hasAnnotation(DEPRECATED_INJECT_MOCK)) { continue; } ``` As I think that we shouldn't process `@MockConfig` and the deprecated `@InjectMock` twice as it sets the same configs, but...
public Consumer<BuildChainBuilder> produce(Index testClassesIndex) { return new Consumer<>() { @Override public void accept(BuildChainBuilder buildChainBuilder) { buildChainBuilder.addBuildStep(new BuildStep() { @Override public vo...
if (instance.name().equals(MOCKITO_CONFIG)
public Consumer<BuildChainBuilder> produce(Index testClassesIndex) { return new Consumer<>() { @Override public void accept(BuildChainBuilder buildChainBuilder) { buildChainBuilder.addBuildStep(new BuildStep() { @Override public vo...
class SingletonToApplicationScopedTestBuildChainCustomizerProducer implements TestBuildChainCustomizerProducer { static final DotName INJECT_MOCK = DotName.createSimple(io.quarkus.test.InjectMock.class.getName()); static final DotName DEPRECATED_INJECT_MOCK = DotName.createSimple(InjectMock.class.getName()); ...
class SingletonToApplicationScopedTestBuildChainCustomizerProducer implements TestBuildChainCustomizerProducer { static final DotName INJECT_MOCK = DotName.createSimple(io.quarkus.test.InjectMock.class.getName()); static final DotName DEPRECATED_INJECT_MOCK = DotName.createSimple(InjectMock.class.getName()); ...
Yep, done. (I originally tried to do this the functional way using streams, but Java doesn't really let you throw checked exceptions from lambdas. 😢 )
public ClassLoader createClassLoader(List<String> inputJarPaths) throws IOException { List<File> localJars = new ArrayList<>(); for (String inputJar : inputJarPaths) { localJars.add(getLocalJar(inputJar)); } List<URL> urls = new ArrayList<>(); for (File file : localJars) { urls.add(file....
localJars.add(getLocalJar(inputJar));
public ClassLoader createClassLoader(List<String> inputJarPaths) throws IOException { List<URL> urls = new ArrayList<>(); for (String inputJar : inputJarPaths) { urls.add(getLocalJar(inputJar).toURI().toURL()); } return createUrlClassLoader(urls.toArray(new URL[0])); }
class implementing %s and annotate it with @AutoService(%s.class).%n" + " 2. Add function %s to the class's userDefinedScalarFunctions implementation.", functionFullName, jarPath, UdfProvider.class.getSimpleName(), UdfProvider.class.get...
class implementing %s and annotate it with @AutoService(%s.class).%n" + " 2. Add function %s to the class's userDefinedScalarFunctions implementation.", functionFullName, jarPath, UdfProvider.class.getSimpleName(), UdfProvider.class.get...
Flink generates its MetricGroup from the operator name which contains the step id. I think it is fine to omit the step name from the generated name.
static String getFlinkMetricNameString(MetricResult<?> metricResult) { return METRIC_KEY_SEPARATOR + metricResult.getStep() + METRIC_KEY_SEPARATOR + metricResult.getName().getNamespace() + METRIC_KEY_SEPARATOR + metricResult.getName().getName(); }
return METRIC_KEY_SEPARATOR
static String getFlinkMetricNameString(MetricResult<?> metricResult) { MetricName metricName = metricResult.getName(); return metricName.getNamespace() + METRIC_KEY_SEPARATOR + metricName.getName(); }
class FlinkMetricContainer { public static final String ACCUMULATOR_NAME = "__metricscontainers"; private static final Logger LOG = LoggerFactory.getLogger(FlinkMetricContainer.class); private static final String METRIC_KEY_SEPARATOR = GlobalConfiguration.loadConfiguration().getString(MetricOptions.SCOPE...
class FlinkMetricContainer { public static final String ACCUMULATOR_NAME = "__metricscontainers"; private static final Logger LOG = LoggerFactory.getLogger(FlinkMetricContainer.class); private static final String METRIC_KEY_SEPARATOR = GlobalConfiguration.loadConfiguration().getString(MetricOptions.SCOPE...
onNext should always contain an item... also, you haven't set `.verify();` on this, so it is not running this test at all.
public void testClaimOwnership() { List<PartitionOwnership> partitionOwnershipList = new ArrayList<>(); StepVerifier.create(store.claimOwnership(partitionOwnershipList)) .assertNext(partitionOwnership -> { Assertions.assertNull(partitionOwnership); }); }
Assertions.assertNull(partitionOwnership);
public void testClaimOwnership() { List<PartitionOwnership> partitionOwnershipList = new ArrayList<>(); StepVerifier.create(store.claimOwnership(partitionOwnershipList)) .verifyComplete(); }
class JedisRedisCheckpointStoreTests { private JedisPool jedisPool; private JedisRedisCheckpointStore store; private Jedis jedis; private JsonSerializer jsonSerializer; private static final String FULLY_QUALIFIED_NAMESPACE = "fullyQualifiedNamespace"; private static final String EVENT_HUB_NAME ...
class JedisRedisCheckpointStoreTests { private JedisPool jedisPool; private JedisRedisCheckpointStore store; private Jedis jedis; private JsonSerializer jsonSerializer; private static final String FULLY_QUALIFIED_NAMESPACE = "fullyQualifiedNamespace"; private static final String EVENT_HUB_NAME ...
Aaaaaha! Yes it does, I suspected there's a good reason for it, I just couldn't see it. I guess it's because `@All` is a regular qualifier -- if it was a special annotation, things would probably look a lot different.
AnnotationsTransformerBuildItem transformListAllInjectionPoints() { return new AnnotationsTransformerBuildItem(new AnnotationsTransformer() { @Override public int getPriority() { return Integer.MIN_VALUE; } @Override public boolean ap...
AnnotationsTransformerBuildItem transformListAllInjectionPoints() { return new AnnotationsTransformerBuildItem(new AnnotationsTransformer() { @Override public int getPriority() { return Integer.MIN_VALUE; } @Override public boolean ap...
class would be ignored during bean discovery transformationContext.transform().add(ADDITIONAL_BEAN).done(); } } } }); builder.setBeanArchiveIndex(index); builder.setApplicationIndex(combinedIndex.getIndex()); List<B...
class would be ignored during bean discovery transformationContext.transform().add(ADDITIONAL_BEAN).done(); } } } }); builder.setBeanArchiveIndex(index); builder.setApplicationIndex(combinedIndex.getIndex()); List<B...
Shouldn't we ideally pass the errors related to WebSocket connection in the onError resource? IMO all other internal errors should be logged in the internal log but should not appear in onError resource since they are not related to WebSocket connection. WDYT?
public static void dispatchError(WebSocketOpenConnectionInfo connectionInfo, Throwable throwable) { WebSocketService webSocketService = connectionInfo.getService(); Resource onErrorResource = webSocketService.getResourceByName(WebSocketConstants.RESOURCE_NAME_ON_ERROR); if (isUnexpectedError(thr...
if (isUnexpectedError(throwable)) {
public static void dispatchError(WebSocketOpenConnectionInfo connectionInfo, Throwable throwable) { WebSocketService webSocketService = connectionInfo.getService(); Resource onErrorResource = webSocketService.getResourceByName(WebSocketConstants.RESOURCE_NAME_ON_ERROR); if (isUnexpectedError(thr...
class WebSocketDispatcher { private static final Logger log = LoggerFactory.getLogger(WebSocketDispatcher.class); /** * This will find the best matching service for given web socket request. * * @param webSocketMessage incoming message. * @return matching service. */ public static...
class WebSocketDispatcher { private static final Logger log = LoggerFactory.getLogger(WebSocketDispatcher.class); /** * This will find the best matching service for given web socket request. * * @param webSocketMessage incoming message. * @return matching service. */ public static...
Is it possible to have a method without any class?
private void checkMethodNamePrefix(DetailAST methodDefToken) { if (TokenUtil.findFirstTokenByPredicate(methodDefToken, parameters -> parameters.getType() == TokenTypes.PARAMETERS && parameters.getChildCount() != 1).isPresent()) { log(methodDefToken, "A fluent method should only ...
if (classNameStack.isEmpty()) {
private void checkMethodNamePrefix(DetailAST methodDefToken) { if (TokenUtil.findFirstTokenByPredicate(methodDefToken, parameters -> parameters.getType() == TokenTypes.PARAMETERS && parameters.getChildCount() != 1).isPresent()) { log(methodDefToken, "A fluent method should only ...
class names when traversals the AST tree. */ private final Deque<String> classNameStack = new ArrayDeque<>(); /** * Adds words that methods in fluent classes should not be prefixed with. * @param avoidStartWords the starting strings that should not start with in fluent method */ public ...
class names when traversals the AST tree. */ private final Deque<String> classNameStack = new ArrayDeque<>(); /** * Adds words that methods in fluent classes should not be prefixed with. * @param avoidStartWords the starting strings that should not start with in fluent method */ public ...
The most risky bug in this code is: The updated code snippet potentially modifies the `expressionMapping` for each column reference even when `allColumnRef` might later be set to false. You can modify the code like this: ``` @@ -292,10 +292,18 @@ private OptExprBuilder window(OptExprBuilder subOpt, List<AnalyticExpr> ...
private OptExprBuilder window(OptExprBuilder subOpt, List<AnalyticExpr> window) { if (window.isEmpty()) { return subOpt; } /* * Build ProjectOperator of partition expression and order by expression in window function. */ List<Expr> projectExpressions = new ...
Map<ColumnRefOperator, ScalarOperator> projections = Maps.newHashMap();
private OptExprBuilder window(OptExprBuilder subOpt, List<AnalyticExpr> window) { if (window.isEmpty()) { return subOpt; } /* * Build ProjectOperator of partition expression and order by expression in window function. */ List<Expr> projectExpressions = new ...
class QueryTransformer { private final ColumnRefFactory columnRefFactory; private final ConnectContext session; private final List<ColumnRefOperator> correlation = new ArrayList<>(); private final CTETransformerContext cteContext; private final boolean inlineView; private final Map<Operator, Par...
class QueryTransformer { private final ColumnRefFactory columnRefFactory; private final ConnectContext session; private final List<ColumnRefOperator> correlation = new ArrayList<>(); private final CTETransformerContext cteContext; private final boolean inlineView; private final Map<Operator, Par...
Can you please make this move in a different commit? Because if we have to revert it something, we don't want to revert the whole thing
private Type getNonAsyncReturnType(Type returnType) { switch (returnType.kind()) { case ARRAY: case CLASS: case PRIMITIVE: case VOID: return returnType; case PARAMETERIZED_TYPE: ParameterizedType paramet...
private Type getNonAsyncReturnType(Type returnType) { switch (returnType.kind()) { case ARRAY: case CLASS: case PRIMITIVE: case VOID: return returnType; case PARAMETERIZED_TYPE: ParameterizedType paramet...
class LinksContainerFactory { private static final String LIST = "list"; private static final String SELF = "self"; private static final String REMOVE = "remove"; private static final String UPDATE = "update"; private static final String ADD = "add"; /** * Find the resource methods that a...
class LinksContainerFactory { private static final String LIST = "list"; private static final String SELF = "self"; private static final String REMOVE = "remove"; private static final String UPDATE = "update"; private static final String ADD = "add"; /** * Find the resource methods that a...
I think I wanted to put `this.getClass().getSimpleName()` there. Will update it.
public void close() throws Exception { synchronized (lock) { if (!running) { return; } running = false; LOG.info("Closing {}.", this); ExecutorUtils.gracefulShutdown(10L, TimeUnit.SECONDS, leadershipOperationExecutor); Ex...
LOG.info("Closing {}.", this);
public void close() throws Exception { synchronized (lock) { if (!running) { return; } running = false; LOG.info("Closing {}.", this.getClass().getSimpleName()); ExecutorUtils.gracefulShutdown(10L, TimeUnit.SECONDS, leadershipOperatio...
class DefaultMultipleComponentLeaderElectionService implements MultipleComponentLeaderElectionService, MultipleComponentLeaderElectionDriver.Listener { private static final Logger LOG = LoggerFactory.getLogger(DefaultMultipleComponentLeaderElectionService.class); private fin...
class DefaultMultipleComponentLeaderElectionService implements MultipleComponentLeaderElectionService, MultipleComponentLeaderElectionDriver.Listener { private static final Logger LOG = LoggerFactory.getLogger(DefaultMultipleComponentLeaderElectionService.class); private fin...
Whether this should be calling into the parent or not, I don't see getters for other properties. Shouldn't there be? In .NET, we almost never have write-only properties: just read-only or read-write.
public Integer getKeySize() { return this.keySize; }
return this.keySize;
public Integer getKeySize() { return this.keySize; }
class CreateOctKeyOptions extends CreateKeyOptions { /** * The AES key size. */ private Integer keySize; /** * The hardware protected indicator for the key. */ private boolean hardwareProtected; /** * Creates a {@link CreateOctKeyOptions} with {@code name} as name of the A...
class CreateOctKeyOptions extends CreateKeyOptions { /** * The AES key size. */ private Integer keySize; /** * The hardware protected indicator for the key. */ private boolean hardwareProtected; /** * Creates a {@link CreateOctKeyOptions} with {@code name} as name of the A...
"But was not thrown or Exception did not match" ??? The failure cause makes it look like the wrong outcome was being met and not the one that was added specifically for this case.
public void testInstructionEmbeddedElementsWithMalformedData() throws Exception { ProcessBundleHandler handler = setupProcessBundleHanlderForSimpleRecordingDoFn(); ByteString.Output encodedData = ByteString.newOutput(); KvCoder.of(StringUtf8Coder.of(), StringUtf8Coder.of()).encode(KV.of("", "data"), encode...
+ " instruction 998L and transform 3L. But was not thrown or Exception did not match.",
public void testInstructionEmbeddedElementsWithMalformedData() throws Exception { List<String> dataOutput = new ArrayList<>(); List<String> timerOutput = new ArrayList<>(); ProcessBundleHandler handler = setupProcessBundleHanlderForSimpleRecordingDoFn(dataOutput, timerOutput); ByteString.Output...
class SimpleRecordingDoFn extends DoFn<KV<String, String>, String> { private static final TupleTag<String> MAIN_OUTPUT_TAG = new TupleTag<>("mainOutput"); private static final String TIMER_FAMILY_ID = "timer_family"; @TimerFamily(TIMER_FAMILY_ID) private final TimerSpec timer = TimerSpecs.timerMap(Time...
class SimpleDoFn extends DoFn<KV<String, String>, String> { private static final TupleTag<String> MAIN_OUTPUT_TAG = new TupleTag<>("mainOutput"); private static final String TIMER_FAMILY_ID = "timer_family"; @TimerFamily(TIMER_FAMILY_ID) private final TimerSpec timer = TimerSpecs.timerMap(TimeDomain.EV...
updated. this TokenUtil would've made everything easier since the beginning. :)
private void checkForOnlyFinalFields(DetailAST objBlockToken) { for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { if (TokenTypes.VARIABLE_DEF == ast.getType()) { final DetailAST modifiersToken = ast.findFirstToken(TokenTypes.MODIFIERS); ...
for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) {
private void checkForOnlyFinalFields(DetailAST objBlockToken) { Optional<DetailAST> nonFinalFieldFound = TokenUtil.findFirstTokenByPredicate(objBlockToken, node -> TokenTypes.VARIABLE_DEF == node.getType() && !node.branchContains(TokenTypes.FINAL) && !Utils.hasIllegalCombination(node...
class are final * * @param objBlockToken the OBJBLOCK AST node */
class are final * * @param objBlockToken the OBJBLOCK AST node */
At the moment the filter instance is created per call. I plan to create a new PR with performance improvements, such as caching web targets, and reusing filters. I will cache the header container proxy in it.
public void filter(ClientRequestContext requestContext) { MultivaluedMap<String, String> headers = new MultivaluedHashMap<>(); requestContext.getHeaders().forEach( (key, values) -> headers.put(key, castToListOfStrings(values))); if (headerFiller != nu...
incomingHeaders = headerContainer.getHeaders();
public void filter(ClientRequestContext requestContext) { MultivaluedMap<String, String> headers = new MultivaluedHashMap<>(); for (Map.Entry<String, List<Object>> headerEntry : requestContext.getHeaders().entrySet()) { headers.put(headerEntry.getKey(), castToListOfStrings...
class MicroProfileRestRequestClientFilter implements ClientRequestFilter { private static final MultivaluedMap<String, String> EMPTY_MAP = new MultivaluedHashMap<>(); @Nullable private final HeaderFiller headerFiller; @NotNull private final ClientHeadersFactory headersFactory; @Nullable pr...
class MicroProfileRestRequestClientFilter implements ClientRequestFilter { private static final MultivaluedMap<String, String> EMPTY_MAP = new MultivaluedHashMap<>(); @Nullable private final HeaderFiller headerFiller; @NotNull private final ClientHeadersFactory headersFactory; @Nullable pr...
Yeah, this test is flaky the way it's written, but we also can't just comment out the assertion since that defeats the purpose of the test. Looking through this file, it looks like we're already creating and deleting a pool for every other test. Can we get rid of the `@BeforeClass` and `@AfterClass` functions? I don't...
public void testPoolOData() throws Exception { CloudPool pool = batchClient.poolOperations().getPool(poolId, new DetailLevel.Builder().withExpandClause("stats").build()); List<CloudPool> pools = batchClient.poolOperations() .listPools(new Deta...
public void testPoolOData() throws Exception { String poolId = getStringIdWithUserNamePrefix("-testPoolOData"); String POOL_VM_SIZE = "STANDARD_D1_V2"; int POOL_VM_COUNT = 2; int POOL_LOW_PRI_VM_COUNT = 2; if (!batchClient.poolOperations().existsPool(poolId)) ...
class PoolTests extends BatchIntegrationTestBase { private static CloudPool livePool; private static String poolId; private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); ...
class PoolTests extends BatchIntegrationTestBase { private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { if(isRecordMode()) { createClient(AuthMode.AAD); } networkConfiguration = createNetworkConfigu...
We could also use `RpcUtils#terminateRpcService` or extend to take multiple `RpcServices` for termination.
public void testDeclineCheckpointInvocationWithUserException() throws Exception { RpcService rpcService1 = null; RpcService rpcService2 = null; try { final ActorSystem actorSystem1 = AkkaUtils.createDefaultActorSystem(); final ActorSystem actorSystem2 = AkkaUtils.createDefaultActorSystem(); rpcService1 ...
FutureUtils.waitForAll(terminationFutures).get(testingTimeout.toMilliseconds(), TimeUnit.MILLISECONDS);
public void testDeclineCheckpointInvocationWithUserException() throws Exception { RpcService rpcService1 = null; RpcService rpcService2 = null; try { final ActorSystem actorSystem1 = AkkaUtils.createDefaultActorSystem(); final ActorSystem actorSystem2 = AkkaUtils.createDefaultActorSystem(); rpcService1 ...
class JobMasterTest extends TestLogger { private static final TestingInputSplit[] EMPTY_TESTING_INPUT_SPLITS = new TestingInputSplit[0]; @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); private static final Time testingTimeout = Time.seconds(10L); private static final long fast...
class JobMasterTest extends TestLogger { private static final TestingInputSplit[] EMPTY_TESTING_INPUT_SPLITS = new TestingInputSplit[0]; @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); private static final Time testingTimeout = Time.seconds(10L); private static final long fast...
"lock" is already in the path so no need for it in the node name imho
public Lock lockVespaServerPool() { return lock(root.append("locks").append("vespaServerPoolLock"), defaultLockTimeout); }
return lock(root.append("locks").append("vespaServerPoolLock"), defaultLockTimeout);
public Lock lockVespaServerPool() { return lock(root.append("locks").append("vespaServerPoolLock"), Duration.ofSeconds(1)); }
class CuratorDb { /** Use a nonstandard zk port to avoid interfering with connection to the config server zk cluster */ private static final int zooKeeperPort = 2281; private static final Logger log = Logger.getLogger(CuratorDb.class.getName()); private static final Path root = Path.fromString("/cont...
class CuratorDb { /** Use a nonstandard zk port to avoid interfering with connection to the config server zk cluster */ private static final int zooKeeperPort = 2281; private static final Logger log = Logger.getLogger(CuratorDb.class.getName()); private static final Path root = Path.fromString("/cont...
@gastaldi How does it look now ? (FYI, I've dropped a `dynamicTenantsConfig` map check as it is initialized in a `PostConstruct` method)
private TenantConfigContext getTenantConfigFromTenantResolver(RoutingContext context) { Assert.assertNotNull(staticTenantsConfig); String tenantId = null; if (tenantResolver.isResolvable()) { tenantId = tenantResolver.get().resolve(context); } TenantConfigContext c...
Assert.assertNotNull(staticTenantsConfig);
private TenantConfigContext getTenantConfigFromTenantResolver(RoutingContext context) { if (staticTenantsConfig == null) { throw new IllegalStateException("staticTenantsConfig is null"); } String tenantId = null; if (tenantResolver.isResolvable()) { tenantId = t...
class + " beans registered"); } } /** * Resolve {@linkplain TenantConfigContext}
class + " beans registered"); } } /** * Resolve {@linkplain TenantConfigContext}