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 |
|---|---|---|---|---|---|
Please remove this useless blank line. | public void execute(final T key, final Runnable childStatement) {
} | public void execute(final T key, final Runnable childStatement) {
taskFeatures.add(getExecutorService(key).submit(childStatement));
} | class DefaultParallelRunnerExecutor<T> implements ParallelRunnerExecutor<T> {
@Getter
private final Collection<Future<?>> taskFeatures = new LinkedList<>();
private final ExecutorService executorService;
public DefaultParallelRunnerExecutor() {
executorService = Executors.newFixed... | class DefaultParallelRunnerExecutor<T> implements ParallelRunnerExecutor<T> {
private final Collection<Future<?>> taskFeatures = new LinkedList<>();
@Getter
private final Map<Object, ExecutorService> executorServiceMap = new ConcurrentHashMap<>();
private volatile ExecutorService defaultE... | |
Please make sure doc writers know about s/label/attribute/ | public void translate(StreamingPubsubIORead<T> transform, TranslationContext context) {
checkArgument(
context.getPipelineOptions().isStreaming(),
"StreamingPubsubIORead is only for streaming pipelines.");
PubsubUnboundedSource<T> overriddenTransform = transform.getOverriddenTransform();... | if (overriddenTransform.getTimestampAttribute() != null) { | public void translate(StreamingPubsubIORead<T> transform, TranslationContext context) {
checkArgument(
context.getPipelineOptions().isStreaming(),
"StreamingPubsubIORead is only for streaming pipelines.");
PubsubUnboundedSource<T> overriddenTransform = transform.getOverriddenTransform();... | class StreamingPubsubIOReadTranslator<T>
implements TransformTranslator<StreamingPubsubIORead<T>> {
@Override
} | class StreamingPubsubIOReadTranslator<T>
implements TransformTranslator<StreamingPubsubIORead<T>> {
@Override
} |
Thanks for your suggestion,i'll update it | public RowData deserialize(byte[] message) throws IOException {
try {
final JsonNode root = objectMapper.readTree(message);
if (root instanceof MissingNode) {
return null;
}
return (RowData) runtimeConverter.convert(root);
} catch (Throwable t) {
if (ignoreParseErrors) {
return null;
}
... | if (root instanceof MissingNode) { | public RowData deserialize(byte[] message) throws IOException {
try {
final JsonNode root = objectMapper.readTree(message);
return (RowData) runtimeConverter.convert(root);
} catch (Throwable t) {
if (ignoreParseErrors) {
return null;
}
throw new IOException(format("Failed to deserialize JSON '%s... | class JsonRowDataDeserializationSchema implements DeserializationSchema<RowData> {
private static final long serialVersionUID = 1L;
/** Flag indicating whether to fail if a field is missing. */
private final boolean failOnMissingField;
/**
* Flag indicating whether to ignore invalid fields/rows (default: throw ... | class JsonRowDataDeserializationSchema implements DeserializationSchema<RowData> {
private static final long serialVersionUID = 1L;
/** Flag indicating whether to fail if a field is missing. */
private final boolean failOnMissingField;
/**
* Flag indicating whether to ignore invalid fields/rows (default: throw ... |
I am not sure I follow, could you explain more? | void writerShouldDiscardRetriedEntriesOnTimeout() throws Exception {
TestSinkInitContextAnyThreadMailbox context = new TestSinkInitContextAnyThreadMailbox();
TestProcessingTimeService tpts = context.getTestProcessingTimeService();
TimeoutWriter writer = new TimeoutWriter(context, 1, 10, 100, fal... | void writerShouldDiscardRetriedEntriesOnTimeout() throws Exception {
TestSinkInitContextAnyThreadMailbox context = new TestSinkInitContextAnyThreadMailbox();
TestProcessingTimeService tpts = context.getTestProcessingTimeService();
TimeoutWriter writer = new TimeoutWriter(context, 1, 10, 100, fal... | class AsyncSinkWriterTimeoutTest {
private final List<Long> destination = new ArrayList<>();
@Test
void writerShouldNotRetryIfRequestIsProcessedBeforeTimeout() throws Exception {
TestSinkInitContextAnyThreadMailbox context = new TestSinkInitContextAnyThreadMailbox();
TestProcessingTimeServi... | class AsyncSinkWriterTimeoutTest {
private final ExecutorService executorService = Executors.newFixedThreadPool(5);
private final List<Long> destination = new ArrayList<>();
@Test
void writerShouldNotRetryIfRequestIsProcessedBeforeTimeout() throws Exception {
TestSinkInitContextAnyThreadMailbo... | |
Identifying the narrowest type will remove the requirement to add `string` here. | public void testNegativeErrorVariables() {
CompileResult resultNegative = BCompileUtil.
compile("test-src/statements/variabledef/error_variable_definition_stmt_negative.bal");
Assert.assertEquals(resultNegative.getErrorCount(), 15);
int i = -1;
BAssertUtil.validateError(r... | "incompatible types: expected 'int', found 'map<(anydata|error|string)>'", 56, 18); | public void testNegativeErrorVariables() {
CompileResult resultNegative = BCompileUtil.
compile("test-src/statements/variabledef/error_variable_definition_stmt_negative.bal");
Assert.assertEquals(resultNegative.getErrorCount(), 15);
int i = -1;
BAssertUtil.validateError(r... | class ErrorVariableDefinitionTest {
private CompileResult result;
@BeforeClass
public void setup() {
result = BCompileUtil.
compile("test-src/statements/variabledef/error_variable_definition_stmt.bal");
}
@Test(description = "Test simple error var def with string and map")
... | class ErrorVariableDefinitionTest {
private CompileResult result;
@BeforeClass
public void setup() {
result = BCompileUtil.
compile("test-src/statements/variabledef/error_variable_definition_stmt.bal");
}
@Test(description = "Test simple error var def with string and map")
... |
(and remove the dump of the stack trace maybe) | public Message<Integer> create() {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
threads.add(Thread.currentThread().getName());
return Message.of(count.incrementAndGet());
} | e.printStackTrace(); | public Message<Integer> create() {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
threads.add(Thread.currentThread().getName());
return Message.of(count.incrementAndGet());
} | class BeanReturningMessages {
private AtomicInteger count = new AtomicInteger();
private List<String> threads = new CopyOnWriteArrayList<>();
@Blocking
@Outgoing("infinite-producer-msg")
public List<String> threads() {
return threads;
}
} | class BeanReturningMessages {
private AtomicInteger count = new AtomicInteger();
private List<String> threads = new CopyOnWriteArrayList<>();
@Blocking
@Outgoing("infinite-producer-msg")
public List<String> threads() {
return threads;
}
} |
You should use the count down latch to increase contention. | public void testConcurrentSamples() throws Exception {
VarIntCoder coder = VarIntCoder.of();
OutputSampler<Integer> outputSampler = new OutputSampler<>(coder, 100000, 1);
Thread sampleThreadA =
new Thread(
() -> {
for (int i = 0; i < 10000000; i++) {
... | Thread sampleThreadA = | public void testConcurrentSamples() throws Exception {
VarIntCoder coder = VarIntCoder.of();
OutputSampler<Integer> outputSampler = new OutputSampler<>(coder, 10, 2);
CountDownLatch startSignal = new CountDownLatch(1);
CountDownLatch doneSignal = new CountDownLatch(2);
Thread sample... | class OutputSamplerTest {
public BeamFnApi.SampledElement encodeInt(Integer i) throws IOException {
VarIntCoder coder = VarIntCoder.of();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
coder.encode(i, stream);
return BeamFnApi.SampledElement.newBuilder()
.setElement(ByteString.cop... | class OutputSamplerTest {
public BeamFnApi.SampledElement encodeInt(Integer i) throws IOException {
VarIntCoder coder = VarIntCoder.of();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
coder.encode(i, stream);
return BeamFnApi.SampledElement.newBuilder()
.setElement(ByteString.cop... |
all `valueOf` methods: default should just return "unknown" so the API doesn't break if we add types. | private static String valueOf(Node.ClusterType type) {
switch (type) {
case admin: return "admin";
case content: return "content";
case container: return "container";
default: throw new IllegalArgumentException("Unexpected node cluster type '" + type + "'.");
... | default: throw new IllegalArgumentException("Unexpected node cluster type '" + type + "'."); | private static String valueOf(Node.ClusterType type) {
switch (type) {
case admin: return "admin";
case content: return "content";
case container: return "container";
default: throw new IllegalArgumentException("Unexpected node cluster type '" + type + "'.");
... | class ApplicationApiHandler extends LoggingRequestHandler {
private static final String OPTIONAL_PREFIX = "/api";
private final Controller controller;
private final AccessControlRequests accessControlRequests;
@Inject
public ApplicationApiHandler(LoggingRequestHandler.Context parentCtx,
... | class ApplicationApiHandler extends LoggingRequestHandler {
private static final String OPTIONAL_PREFIX = "/api";
private final Controller controller;
private final AccessControlRequests accessControlRequests;
@Inject
public ApplicationApiHandler(LoggingRequestHandler.Context parentCtx,
... |
@yrodiere @Sanne could one of you have a look at this part? It changes how persistence units are started. | void startAll() {
List<CompletableFuture<?>> start = new ArrayList<>();
for (Map.Entry<String, LazyPersistenceUnit> i : persistenceUnits.entrySet()) {
CompletableFuture<Object> future = new CompletableFuture<>();
start.add(future);
... | List<CompletableFuture<?>> start = new ArrayList<>(); | void startAll() {
List<CompletableFuture<?>> start = new ArrayList<>();
for (Map.Entry<String, LazyPersistenceUnit> i : persistenceUnits.entrySet()) {
CompletableFuture<Object> future = new CompletableFuture<>();
start.add(future);
... | class JPAConfig {
private static final Logger LOGGER = Logger.getLogger(JPAConfig.class.getName());
private final Map<String, Set<String>> entityPersistenceUnitMapping;
private final Map<String, LazyPersistenceUnit> persistenceUnits;
@Inject
public JPAConfig(JPAConfigSupport jpaConfigSupport) {
... | class JPAConfig {
private static final Logger LOGGER = Logger.getLogger(JPAConfig.class.getName());
private final Map<String, Set<String>> entityPersistenceUnitMapping;
private final Map<String, LazyPersistenceUnit> persistenceUnits;
@Inject
public JPAConfig(JPAConfigSupport jpaConfigSupport) {
... |
@samvaity - agreed, we can add nested / non-nested information on context always irrespective of the API if it doesn't result in a perf hit. Added it to this issue: https://github.com/Azure/azure-sdk-for-java/issues/13031 | private CosmosPagedFlux<CosmosDatabaseProperties> queryDatabasesInternal(SqlQuerySpec querySpec, CosmosQueryRequestOptions options){
return UtilBridgeInternal.createCosmosPagedFlux(pagedFluxOptions -> {
pagedFluxOptions.setTracerInformation(this.tracerProvider, "queryDatabases", this.serviceEndpoint... | pagedFluxOptions.setTracerInformation(this.tracerProvider, "queryDatabases", this.serviceEndpoint, null); | private CosmosPagedFlux<CosmosDatabaseProperties> queryDatabasesInternal(SqlQuerySpec querySpec, CosmosQueryRequestOptions options){
return UtilBridgeInternal.createCosmosPagedFlux(pagedFluxOptions -> {
pagedFluxOptions.setTracerInformation(this.tracerProvider, "queryDatabases", this.serviceEndpoint... | class CosmosAsyncClient implements Closeable {
private final Configs configs;
private final AsyncDocumentClient asyncDocumentClient;
private final String serviceEndpoint;
private final String keyOrResourceToken;
private final ConnectionPolicy connectionPolicy;
private final ConsistencyLeve... | class CosmosAsyncClient implements Closeable {
private final Configs configs;
private final AsyncDocumentClient asyncDocumentClient;
private final String serviceEndpoint;
private final String keyOrResourceToken;
private final ConnectionPolicy connectionPolicy;
private final ConsistencyLeve... |
Isn't idle timeout a little different from response timeout? From their docs, this will close the connection if the connection doesn't send or receive any data: https://vertx.io/docs/apidocs/io/vertx/core/http/HttpClientOptions.html#setIdleTimeout-int- | public Mono<HttpResponse> send(HttpRequest request, Context context) {
boolean eagerlyReadResponse = (boolean) context.getData(HttpUtils.AZURE_EAGERLY_READ_RESPONSE).orElse(false);
boolean ignoreResponseBody = (boolean) context.getData(HttpUtils.AZURE_IGNORE_RESPONSE_BODY).orElse(false);
Long re... | options.setIdleTimeout(responseTimeout); | public Mono<HttpResponse> send(HttpRequest request, Context context) {
return Mono.deferContextual(contextView -> Mono.fromFuture(sendInternal(request, context, contextView)))
.onErrorMap(VertxUtils::wrapVertxException);
} | class VertxAsyncHttpClient implements HttpClient {
private final Vertx vertx;
final io.vertx.core.http.HttpClient client;
/**
* Constructs a {@link VertxAsyncHttpClient}.
*
* @param client The Vert.x {@link io.vertx.core.http.HttpClient}
*/
VertxAsyncHttpClient(io.vertx.core.http.Ht... | class VertxAsyncHttpClient implements HttpClient {
private static final ClientLogger LOGGER = new ClientLogger(VertxAsyncHttpClient.class);
final io.vertx.core.http.HttpClient client;
private final Duration responseTimeout;
/**
* Constructs a {@link VertxAsyncHttpClient}.
*
* @param cli... |
Decreasing parallelism just a little bit would cover more cases, WDYT? i.e. ```suggestion int scaledDownParallelism = PARALLELISM - 1; ``` | void testRequirementDecreaseTriggersScaleDown() throws Exception {
final JobGraph jobGraph = createJobGraph();
final DefaultDeclarativeSlotPool declarativeSlotPool =
createDeclarativeSlotPool(jobGraph.getJobID());
final Configuration configuration = new Configuration();
... | int scaledDownParallelism = PARALLELISM / 2; | void testRequirementDecreaseTriggersScaleDown() throws Exception {
final JobGraph jobGraph = createJobGraph();
final DefaultDeclarativeSlotPool declarativeSlotPool =
createDeclarativeSlotPool(jobGraph.getJobID());
final AdaptiveScheduler scheduler =
createSchedu... | class AdaptiveSchedulerTest {
private static final Duration DEFAULT_TIMEOUT = Duration.ofHours(1);
private static final int PARALLELISM = 4;
private static final JobVertex JOB_VERTEX = createNoOpVertex("v1", PARALLELISM);
private static final Logger LOG = LoggerFactory.getLogger(AdaptiveSchedulerTest.... | class AdaptiveSchedulerTest {
private static final Duration DEFAULT_TIMEOUT = Duration.ofHours(1);
private static final int PARALLELISM = 4;
private static final JobVertex JOB_VERTEX = createNoOpVertex("v1", PARALLELISM);
private static final Logger LOG = LoggerFactory.getLogger(AdaptiveSchedulerTest.... |
```suggestion throw createLauncherException("unable to create the executable:" + e.getMessage()); ``` | public void execute() {
long start = 0;
if (this.helpFlag) {
String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(RUN_COMMAND);
this.errStream.println(commandUsageInfo);
return;
}
if (this.debugPort != null) {
Syste... | throw createLauncherException("unable to create executable:" + e.getMessage()); | public void execute() {
long start = 0;
if (this.helpFlag) {
String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(RUN_COMMAND);
this.errStream.println(commandUsageInfo);
return;
}
if (this.debugPort != null) {
Syste... | class RunCommand implements BLauncherCmd {
private final PrintStream outStream;
private final PrintStream errStream;
private Path projectPath;
private boolean exitWhenFinish;
private static final PathMatcher JAR_EXTENSION_MATCHER =
FileSystems.getDefault().getPathMatcher("glob:**.jar")... | class RunCommand implements BLauncherCmd {
private final PrintStream outStream;
private final PrintStream errStream;
private Path projectPath;
private boolean exitWhenFinish;
private static final PathMatcher JAR_EXTENSION_MATCHER =
FileSystems.getDefault().getPathMatcher("glob:**.jar")... |
You are correct that this was not correct, especially also on partially completed tasks. I changed it to regular state and let the committer handle duplicates now. The main idea is to avoid extra transactions as much as possible in the writer and if it's not possible, let the committer clean them up anyhow. | public void endInput() throws Exception {
if (!this.endOfInput) {
this.endOfInput = true;
if (getRuntimeContext().getTaskInfo().getIndexOfThisSubtask() == 0) {
endOfInputState.add(true);
}
sinkWriter.flush(true);
emitCommit... | public void endInput() throws Exception {
if (!endOfInput) {
endOfInput = true;
if (endOfInputState != null) {
endOfInputState.add(true);
}
sinkWriter.flush(true);
emitCommittables(CommittableMessage.EOI);
}
} | class SinkWriterOperator<InputT, CommT> extends AbstractStreamOperator<CommittableMessage<CommT>>
implements OneInputStreamOperator<InputT, CommittableMessage<CommT>>, BoundedOneInput {
/**
* To support state migrations from 1.14 where the sinkWriter and committer where part of the
* same operato... | class SinkWriterOperator<InputT, CommT> extends AbstractStreamOperator<CommittableMessage<CommT>>
implements OneInputStreamOperator<InputT, CommittableMessage<CommT>>, BoundedOneInput {
/**
* To support state migrations from 1.14 where the sinkWriter and committer where part of the
* same operato... | |
We moved this part to the mailing list because it pertains to the design and the FLIP-150 that hasn't been updated and finalized. | private void switchEnumerator() {
Object enumeratorState = null;
if (currentEnumerator != null) {
try {
enumeratorState = currentEnumerator.snapshotState(-1);
currentEnumerator.close();
} catch (Exception e) {
throw new RuntimeExce... | enumeratorState = currentEnumerator.snapshotState(-1); | private void switchEnumerator() {
SplitEnumerator<SourceSplit, Object> previousEnumerator = currentEnumerator;
if (currentEnumerator != null) {
try {
currentEnumerator.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
... | class HybridSourceSplitEnumerator<SplitT extends SourceSplit>
implements SplitEnumerator<HybridSourceSplit<SplitT>, HybridSourceEnumeratorState> {
private static final Logger LOG = LoggerFactory.getLogger(HybridSourceSplitEnumerator.class);
private final SplitEnumeratorContext<HybridSourceSplit> contex... | class HybridSourceSplitEnumerator
implements SplitEnumerator<HybridSourceSplit, HybridSourceEnumeratorState> {
private static final Logger LOG = LoggerFactory.getLogger(HybridSourceSplitEnumerator.class);
private final SplitEnumeratorContext<HybridSourceSplit> context;
private final List<HybridSour... |
Whether it is in the name or not, I think is a secondary issue. If we provide some stats, it's best if all have the same units. https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/metrics.html#checkpointing however, annoying thing is, that in this class yes, all units are in nanos, but in other places i... | protected void markCheckpointStart(long checkpointCreationTimestamp) {
latestCheckpointStartDelayNanos = 1000_000 * Math.max(
0,
System.currentTimeMillis() - checkpointCreationTimestamp);
} | latestCheckpointStartDelayNanos = 1000_000 * Math.max( | protected void markCheckpointStart(long checkpointCreationTimestamp) {
latestCheckpointStartDelayNanos = 1_000_000 * Math.max(
0,
System.currentTimeMillis() - checkpointCreationTimestamp);
} | class CheckpointBarrierHandler {
/** The listener to be notified on complete checkpoints. */
private final AbstractInvokable toNotifyOnCheckpoint;
private long latestCheckpointStartDelayNanos;
public CheckpointBarrierHandler(AbstractInvokable toNotifyOnCheckpoint) {
this.toNotifyOnCheckpoint = checkNotNull(toN... | class CheckpointBarrierHandler {
/** The listener to be notified on complete checkpoints. */
private final AbstractInvokable toNotifyOnCheckpoint;
private long latestCheckpointStartDelayNanos;
public CheckpointBarrierHandler(AbstractInvokable toNotifyOnCheckpoint) {
this.toNotifyOnCheckpoint = checkNotNull(toN... |
I solved it by setting it to `numSplits + 2`. | public void testMetrics() throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(4);
env.getConfig().setAutoWatermarkInterval(1L);
int numSplits = 2;
int numRecordsPerSplit = 10;
MockBaseSource source ... | env.setParallelism(4); | public void testMetrics() throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
int numSplits = Math.max(1, env.getParallelism() - 2);
env.getConfig().setAutoWatermarkInterval(1L);
int numRecordsPerSplit = 10;
MockBaseSource so... | class CoordinatedSourceITCase extends AbstractTestBase {
@Rule public SharedObjects sharedObjects = SharedObjects.create();
private static final long EVENTTIME_LAG = Duration.ofDays(100).toMillis();
private static final long WATERMARK_LAG = Duration.ofDays(1).toMillis();
private static final long ... | class CoordinatedSourceITCase extends AbstractTestBase {
private static final long EVENTTIME_LAG = Duration.ofDays(100).toMillis();
private static final long WATERMARK_LAG = Duration.ofDays(1).toMillis();
private static final long EVENTTIME_EPSILON = Duration.ofDays(20).toMillis();
private sta... |
Yes, I gave up on a very few of these :) | public StatusPageResponse fetchStatusPage(StatusPageServer.HttpRequest httpRequest) {
verifyInControllerThread();
StatusPageResponse.ResponseCode responseCode;
String message;
String hiddenMessage = "";
try {
StatusPageServer.RequestHandler handler = statusRequestRout... | log.log(Level.FINE, "Unknown exception thrown for request " + httpRequest.getRequest() + ": " + hiddenMessage); | public StatusPageResponse fetchStatusPage(StatusPageServer.HttpRequest httpRequest) {
verifyInControllerThread();
StatusPageResponse.ResponseCode responseCode;
String message;
String hiddenMessage = "";
try {
StatusPageServer.RequestHandler handler = statusRequestRout... | class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAddedOrRemovedListener, SystemStateListener,
Runnable, RemoteClusterControllerTaskScheduler {
private static final Logger log = Logger.getLogger(FleetController.class.getName());
private final Timer ... | class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAddedOrRemovedListener, SystemStateListener,
Runnable, RemoteClusterControllerTaskScheduler {
private static final Logger log = Logger.getLogger(FleetController.class.getName());
private final Timer ... |
Shall we add the max depth validation as well? If not there is a chance of SO for the following ``` type ER1 error<record {| ER1 e?; |}>; public function main() { ER1 er1 = getER1(); } function getER1() { return error("", e<cursor>) ``` | private static Optional<String> getDefaultValueForType(TypeSymbol bType, int depth) {
String typeString;
if (bType == null) {
return Optional.empty();
}
TypeSymbol rawType = getRawType(bType);
TypeDescKind typeKind = rawType.typeKind();
switch (typeKind) {
... | if (errorType.typeKind() == TypeDescKind.RECORD) { | private static Optional<String> getDefaultValueForType(TypeSymbol bType, int depth) {
String typeString;
if (bType == null) {
return Optional.empty();
}
TypeSymbol rawType = getRawType(bType);
TypeDescKind typeKind = rawType.typeKind();
switch (typeKind) {
... | class CommonUtil {
public static final String MD_LINE_SEPARATOR = " " + System.lineSeparator();
public static final String LINE_SEPARATOR = System.lineSeparator();
public static final String FILE_SEPARATOR = File.separator;
public static final Pattern MD_NEW_LINE_PATTERN = Pattern.compile("\\s\\s\\... | class CommonUtil {
public static final String MD_LINE_SEPARATOR = " " + System.lineSeparator();
public static final String LINE_SEPARATOR = System.lineSeparator();
public static final String FILE_SEPARATOR = File.separator;
public static final Pattern MD_NEW_LINE_PATTERN = Pattern.compile("\\s\\s\\... |
The code you pasted is not the latest. The `fillDisableDictOptimizeColumns(v, columnRefSet, sids)` function just check if the operator can be optimized, if not it union these cols just like code in line#127. So if we have done the union operation before, the further check is unnecessary. | public void fillDisableDictOptimizeColumns(ColumnRefSet columnRefSet, Set<Integer> sids) {
columnRefMap.forEach((k, v) -> {
if (columnRefSet.contains(k.getId())) {
columnRefSet.union(v.getUsedColumns());
} else {
fillDisableDictOptimizeColumns(v, columnRef... | fillDisableDictOptimizeColumns(v, columnRefSet, sids); | public void fillDisableDictOptimizeColumns(ColumnRefSet columnRefSet, Set<Integer> sids) {
columnRefMap.forEach((k, v) -> {
if (columnRefSet.contains(k.getId())) {
columnRefSet.union(v.getUsedColumns());
} else {
fillDisableDictOptimizeColumns(v, columnRef... | class Projection {
private final Map<ColumnRefOperator, ScalarOperator> columnRefMap;
private final Map<ColumnRefOperator, ScalarOperator> commonSubOperatorMap;
public Projection(Map<ColumnRefOperator, ScalarOperator> columnRefMap) {
this.columnRefMap = columnRefMap;
this.commonSu... | class Projection {
private final Map<ColumnRefOperator, ScalarOperator> columnRefMap;
private final Map<ColumnRefOperator, ScalarOperator> commonSubOperatorMap;
public Projection(Map<ColumnRefOperator, ScalarOperator> columnRefMap) {
this.columnRefMap = columnRefMap;
this.commonSu... |
And yes, you need that many backslashes :] | private static String escapeXrefTitleForReplaceAll(String title) {
return title.trim().replace("]", "\\\\]");
} | return title.trim().replace("]", "\\\\]"); | private static String escapeXrefTitleForReplaceAll(String title) {
return title.trim().replace("]", "\\\\]");
} | class AssembleDownstreamDocumentation {
private static final Logger LOG = Logger.getLogger(AssembleDownstreamDocumentation.class);
private static final Path SOURCE_DOC_PATH = Path.of("src", "main", "asciidoc");
private static final Path DOC_PATH = Path.of("target", "asciidoc", "sources");
private stat... | class AssembleDownstreamDocumentation {
private static final Logger LOG = Logger.getLogger(AssembleDownstreamDocumentation.class);
private static final Path SOURCE_DOC_PATH = Path.of("src", "main", "asciidoc");
private static final Path DOC_PATH = Path.of("target", "asciidoc", "sources");
private stat... |
That's true. Reverted to former implementation due to using ArrayList, see comment elsewhere. | private void deleteLines(int startIndex, int endIndex) {
for (int i = startIndex; i < endIndex; ++i) {
lines.remove(startIndex);
}
} | lines.remove(startIndex); | private void deleteLines(int startIndex, int endIndex) {
for (int fromIndex = endIndex, toIndex = startIndex; fromIndex <= getMaxLineIndex();
++toIndex, ++fromIndex) {
lines.set(toIndex, lines.get(fromIndex));
}
truncate(getMaxLineIndex() - (endIndex - startIndex));
... | class TextBufferImpl implements TextBuffer {
/** Invariant: {@code size() >= 1}. An empty text buffer {@code => [""]} */
private final LinkedList<String> lines = new LinkedList<>();
private Version version = new Version();
TextBufferImpl() {
lines.add("");
}
TextBufferImpl(String text... | class TextBufferImpl implements TextBuffer {
/** Invariant: {@code size() >= 1}. An empty text buffer {@code => [""]} */
private final ArrayList<String> lines = new ArrayList<>();
private Version version = new Version();
TextBufferImpl() {
lines.add("");
}
TextBufferImpl(String text) ... |
Dont you need ":port" as well when configserverConfig.zookeeperLocalhostAffinity() is true? | private Curator(ConfigserverConfig configserverConfig, String zooKeeperEnsembleConnectionSpec) {
this(configserverConfig.zookeeperLocalhostAffinity() ?
HostName.getLocalhost() : zooKeeperEnsembleConnectionSpec,
zooKeeperEnsembleConnectionSpec);
} | HostName.getLocalhost() : zooKeeperEnsembleConnectionSpec, | private Curator(ConfigserverConfig configserverConfig, String zooKeeperEnsembleConnectionSpec) {
this(configserverConfig.zookeeperLocalhostAffinity() ?
createConnectionSpecForLocalhost(configserverConfig) : zooKeeperEnsembleConnectionSpec,
zooKeeperEnsembleConnectionSpec);
} | class Curator implements AutoCloseable {
private static final long UNKNOWN_HOST_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(30);
private static final int ZK_SESSION_TIMEOUT = 30000;
private static final int ZK_CONNECTION_TIMEOUT = 30000;
private static final int BASE_SLEEP_TIME = 1000;
private sta... | class Curator implements AutoCloseable {
private static final long UNKNOWN_HOST_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(30);
private static final int ZK_SESSION_TIMEOUT = 30000;
private static final int ZK_CONNECTION_TIMEOUT = 30000;
private static final int BASE_SLEEP_TIME = 1000;
private sta... |
@warunalakshitha @MaryamZi Ack.. I'll modify the debugger side to preprocess the type string before sending it to the frontend. | 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... |
>om", [](start = 18, length = 4) We are making type mandatory in .net, can do the same here: [https://github.com/Azure/azure-cosmos-dotnet-v3/pull/2283](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/2283) | public EncryptionKeyWrapMetadata(String name, String value) {
this("custom", name, value, null);
} | this("custom", name, value, null); | public EncryptionKeyWrapMetadata(String name, String value) {
this("custom", name, value, null);
} | class EncryptionKeyWrapMetadata {
/**
* For JSON deserialize
*/
EncryptionKeyWrapMetadata() {
}
/**
* Creates a new instance of key wrap metadata based on an existing instance.
*
* @param source Existing instance from which to initialize.
*/
@Beta(value = Beta.SinceVe... | class EncryptionKeyWrapMetadata {
/**
* For JSON deserialize
*/
EncryptionKeyWrapMetadata() {
}
/**
* Creates a new instance of key wrap metadata based on an existing instance.
*
* @param source Existing instance from which to initialize.
*/
@Beta(value = Beta.SinceVe... |
> quorumPeer.running should be set to false (under a synchronized(quorumPeer)), which means the quorumPeer thread will eventually exit its thread `quorumPeer.running` is private though, as far as I can tell we can only initiate shutdown through `quorumPeer.shutdown()` > wait until quorumPeer thread exits with quorumP... | public void shutdown() {
if (quorumPeer != null) {
try {
quorumPeer.shutdown();
} catch (RuntimeException e) {
LOG.log(Level.SEVERE, "Failed to shut down ... | quorumPeer.shutdown(); | public void shutdown() {
if (quorumPeer != null) {
try {
quorumPeer.shutdown();
} catch (RuntimeException e) {
LOG.log(Level.SEVERE, "Failed to shut down ... | class VespaQuorumPeer extends QuorumPeerMain {
private static final Logger LOG = Logger.getLogger(VespaQuorumPeer.class.getName());
public void start(Path path) {
initializeAndRun(new String[]{ path.toFile().getAbsolutePath()});
}
@Override
protected void initializeAndRun(String[] a... | class VespaQuorumPeer extends QuorumPeerMain {
private static final Logger LOG = Logger.getLogger(VespaQuorumPeer.class.getName());
public void start(Path path) {
initializeAndRun(new String[]{ path.toFile().getAbsolutePath()});
}
@Override
protected void initializeAndRun(String[] a... |
I see. Thanks for spotting this! | public void test() {
get("/ping?val=bar").then().statusCode(200).body(is("foo_bar"));
assertTrue(Ping.DESTROYED.get());
} | assertTrue(Ping.DESTROYED.get()); | public void test() throws InterruptedException, ExecutionException, TimeoutException {
get("/ping?val=bar").then().statusCode(200).body(is("foo_bar"));
assertTrue(Ping.DESTROYED.get(2, TimeUnit.SECONDS));
} | class RequestContextPropagationTest {
@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addClasses(MyRoutes.class, Ping.class));
@Test
@Singleton
static class MyRoutes... | class RequestContextPropagationTest {
@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addClasses(MyRoutes.class, Ping.class));
@Test
@Singleton
static class MyRoutes... |
@xinyuiscool is this issue something that affects you or that you have noticed? | public static void convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(Pipeline pipeline) {
if (!ExperimentalOptions.hasExperiment(pipeline.getOptions(), "use_sdf_read")
|| ExperimentalOptions.hasExperiment(
pipeline.getOptions(), "beam_fn_api_use_deprecated_read")
|| Experimental... | if (!ExperimentalOptions.hasExperiment(pipeline.getOptions(), "use_sdf_read") | public static void convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(Pipeline pipeline) {
if (!ExperimentalOptions.hasExperiment(pipeline.getOptions(), "use_sdf_read")
|| ExperimentalOptions.hasExperiment(
pipeline.getOptions(), "beam_fn_api_use_deprecated_read")
|| Experimental... | class SplitRestrictionFn<InputT, RestrictionT>
extends DoFn<KV<InputT, RestrictionT>, KV<InputT, RestrictionT>> {
private final DoFn<InputT, ?> splittableFn;
private transient @Nullable DoFnInvoker<InputT, ?> invoker;
SplitRestrictionFn(DoFn<InputT, ?> splittableFn) {
this.splittableFn = ... | class SplitRestrictionFn<InputT, RestrictionT>
extends DoFn<KV<InputT, RestrictionT>, KV<InputT, RestrictionT>> {
private final DoFn<InputT, ?> splittableFn;
private transient @Nullable DoFnInvoker<InputT, ?> invoker;
SplitRestrictionFn(DoFn<InputT, ?> splittableFn) {
this.splittableFn = ... |
Maybe a stupid question, but how are the `partitionWriters` connected to the `StreamTask` under the test? | public void testRpcTriggerCheckpointWithSourceChain() throws Exception {
ResultPartition[] partitionWriters = new ResultPartition[2];
try {
for (int i = 0; i < partitionWriters.length; ++i) {
partitionWriters[i] =
PartitionTestUtils.createPartition(Res... | for (int i = 0; i < partitionWriters.length; ++i) { | public void testRpcTriggerCheckpointWithSourceChain() throws Exception {
ResultPartition[] partitionWriters = new ResultPartition[2];
try {
for (int i = 0; i < partitionWriters.length; ++i) {
partitionWriters[i] =
PartitionTestUtils.createPartition(Res... | class MultipleInputStreamTaskChainedSourcesCheckpointingTest {
private static final int MAX_STEPS = 100;
private final CheckpointMetaData metaData =
new CheckpointMetaData(1L, System.currentTimeMillis());
/**
* In this scenario: 1. checkpoint is triggered via RPC and source is blocked 2. ... | class MultipleInputStreamTaskChainedSourcesCheckpointingTest {
private static final int MAX_STEPS = 100;
private final CheckpointMetaData metaData =
new CheckpointMetaData(1L, System.currentTimeMillis());
/**
* In this scenario: 1. checkpoint is triggered via RPC and source is blocked 2. ... |
Looks like the we missed one line here? | public void testStreamPartitionReadByPartitionName() throws Exception {
final String catalogName = "hive";
final String dbName = "source_db";
final String tblName = "stream_partition_name_test";
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
... | Row.of(i, "new_add").toString(), Row.of(i, "new_add_1").toString()), | public void testStreamPartitionReadByPartitionName() throws Exception {
final String catalogName = "hive";
final String dbName = "source_db";
final String tblName = "stream_partition_name_test";
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
... | class HiveTableSourceITCase extends BatchAbstractTestBase {
private static HiveCatalog hiveCatalog;
private static TableEnvironment batchTableEnv;
@BeforeClass
public static void createCatalog() {
hiveCatalog = HiveTestUtils.createHiveCatalog();
hiveCatalog.open();
batchTableEn... | class HiveTableSourceITCase extends BatchAbstractTestBase {
private static HiveCatalog hiveCatalog;
private static TableEnvironment batchTableEnv;
@BeforeClass
public static void createCatalog() {
hiveCatalog = HiveTestUtils.createHiveCatalog();
hiveCatalog.open();
batchTableEn... |
Agree that we don't need this. Preserving the order per application is sufficient. | public void setRoutingStatus(ZoneId zone, RoutingStatus.Value value) {
try (var lock = db.lockRoutingPolicies()) {
db.writeZoneRoutingPolicy(new ZoneRoutingPolicy(zone, RoutingStatus.create(value, RoutingStatus.Agent.operator,
... | updateGlobalDnsOf(instancePolicies, Set.of(), Optional.empty(), lock); | public void setRoutingStatus(ZoneId zone, RoutingStatus.Value value) {
try (var lock = db.lockRoutingPolicies()) {
db.writeZoneRoutingPolicy(new ZoneRoutingPolicy(zone, RoutingStatus.create(value, RoutingStatus.Agent.operator,
... | class RoutingPolicies {
private final Controller controller;
private final CuratorDb db;
public RoutingPolicies(Controller controller) {
this.controller = Objects.requireNonNull(controller, "controller must be non-null");
this.db = controller.curator();
try (var lock = db.lockRouti... | class RoutingPolicies {
private final Controller controller;
private final CuratorDb db;
public RoutingPolicies(Controller controller) {
this.controller = Objects.requireNonNull(controller, "controller must be non-null");
this.db = controller.curator();
try (var lock = db.lockRouti... |
I would say that I wouldn't import a Google class just for that. So I would remove it for now and revisit if the changes you made are not stable enough. | void createMultipleTimes() throws InterruptedException {
final ExecutorService executorService = Executors.newFixedThreadPool(4);
final CountDownLatch latch = new CountDownLatch(20);
final Stopwatch watch = Stopwatch.createStarted();
Map<String, Object> properties = new HashMap<>();
... | System.out.println(watch.toString()); | void createMultipleTimes() throws InterruptedException {
final ExecutorService executorService = Executors.newFixedThreadPool(4);
final CountDownLatch latch = new CountDownLatch(20);
Map<String, Object> properties = new HashMap<>();
properties.put("extensions", "commons-io:commons-io:2.5... | class CreateProjectTest {
@Test
public void create() throws IOException {
final File file = new File("target/basic-rest");
delete(file);
final CreateProject createProject = new CreateProject(new FileProjectWriter(file)).groupId("io.quarkus")
.artifactId("basic-rest")
... | class CreateProjectTest {
@Test
public void create() throws IOException {
final File file = new File("target/basic-rest");
delete(file);
final CreateProject createProject = new CreateProject(new FileProjectWriter(file)).groupId("io.quarkus")
.artifactId("basic-rest")
... |
The most risky bug in this code is: Using the `getType().isComplexType()` check and introducing the `isJsonType()` check without considering that a `Type` can be both complex and JSON. You can modify the code like this: ```java // was if (variable.getType().isComplexType()) { // now if (variable.getType().isComplexTy... | private Optional<AccessPath> process(ScalarOperator scalarOperator, Deque<AccessPath> accessPaths) {
List<Optional<AccessPath>> childAccessPaths = scalarOperator.getChildren().stream()
.map(child -> process(child, accessPaths))
.collect(Collectors.toList(... | List<Optional<AccessPath>> childAccessPaths = scalarOperator.getChildren().stream() | private Optional<AccessPath> process(ScalarOperator scalarOperator, Deque<AccessPath> accessPaths) {
List<Optional<AccessPath>> childAccessPaths = scalarOperator.getChildren().stream()
.map(child -> process(child, accessPaths))
.collect(Collectors.toList(... | class Collector extends ScalarOperatorVisitor<Optional<AccessPath>, List<Optional<AccessPath>>> {
@Override
public Optional<AccessPath> visit(ScalarOperator scalarOperator,
List<Optional<AccessPath>> childrenAccessPaths) {
return Optional.empty();
... | class Collector extends ScalarOperatorVisitor<Optional<AccessPath>, List<Optional<AccessPath>>> {
@Override
public Optional<AccessPath> visit(ScalarOperator scalarOperator,
List<Optional<AccessPath>> childrenAccessPaths) {
return Optional.empty();
... |
You drop it because we don't care about it past that line right? | public static void manualInitialize() {
int tmpState = manualState;
if (tmpState == MANUAL_FAILURE)
throw new RuntimeException("Quarkus manual bootstrap failed");
if (tmpState > MANUAL_BEGIN)
return;
synchronized (manualLock) {
tmpState = manualState;
... | manualState = MANUAL_BEGIN_INITIALIZATION; | public static void manualInitialize() {
int tmpState = manualState;
if (tmpState == MANUAL_FAILURE)
throw new RuntimeException("Quarkus manual bootstrap failed");
if (tmpState > MANUAL_BEGIN)
return;
synchronized (manualLock) {
tmpState = manualState;
... | class QuarkusCracBootstrapResource implements Resource {
@Override
public void beforeCheckpoint(Context<? extends Resource> context) throws Exception {
}
@Override
public void afterRestore(Context<? extends Resource> context) throws Exception {
manualStart();
... | class QuarkusCracBootstrapResource implements Resource {
@Override
public void beforeCheckpoint(Context<? extends Resource> context) throws Exception {
}
@Override
public void afterRestore(Context<? extends Resource> context) throws Exception {
manualStart();
... |
Changed the exception type with 1d90337 | public static void uninstallPackage(String fullPkgPath) {
String orgName;
String packageName;
String version;
int orgNameIndex = fullPkgPath.indexOf("/");
if (orgNameIndex == -1) {
throw new BLangCompilerException("no org-name is provided");
}
... | throw new BLangCompilerException("no package version is provided"); | public static void uninstallPackage(String fullPkgPath) {
String orgName;
String packageName;
String version;
int orgNameIndex = fullPkgPath.indexOf("/");
if (orgNameIndex == -1) {
throw LauncherUtils.createLauncherException("error: no org-name is provided");... | class UninstallUtils {
private static final Path BALLERINA_HOME_PATH = RepoUtils.createAndGetHomeReposPath();
private static PrintStream outStream = System.out;
/**
* Uninstalls the package from the home repository.
*
* @param fullPkgPath package provided
*/
/**
* Remove ... | class UninstallUtils {
private static final Path BALLERINA_HOME_PATH = RepoUtils.createAndGetHomeReposPath();
private static PrintStream outStream = System.out;
/**
* Uninstalls the package from the home repository.
*
* @param fullPkgPath package provided
*/
/**
* Remove ... |
Yes, we can do that too. Since this is implementation detail, will change it in next PR . | public static String decodeAsUTF8String(String inputString) {
if (inputString == null || inputString.isEmpty()) {
return inputString;
}
try {
return URLDecoder.decode(inputString, StandardCharsets.UTF_8.toString());
} catch (UnsupportedEncodingException e) {
... | if (inputString == null || inputString.isEmpty()) { | public static String decodeAsUTF8String(String inputString) {
if (inputString == null || inputString.isEmpty()) {
return inputString;
}
try {
return URLDecoder.decode(inputString, StandardCharsets.UTF_8.toString());
} catch (UnsupportedEncodingException e) {
... | class Utils {
private final static Logger logger = LoggerFactory.getLogger(Utils.class);
private static final int ONE_KB = 1024;
private static final ZoneId GMT_ZONE_ID = ZoneId.of("GMT");
public static final Base64.Encoder Base64Encoder = Base64.getEncoder();
public static final Base64.Decoder Ba... | class Utils {
private final static Logger logger = LoggerFactory.getLogger(Utils.class);
private static final int ONE_KB = 1024;
private static final ZoneId GMT_ZONE_ID = ZoneId.of("GMT");
public static final Base64.Encoder Base64Encoder = Base64.getEncoder();
public static final Base64.Decoder Ba... |
In https://github.com/ballerina-platform/ballerina-lang/pull/20679, we added an entry to `expr.narrowedTypeInfo` to redefine any narrowed symbols in subsequent scopes, if the type narrowing for that symbol is reset in the current scope (L2192 - L2194). Can't we rely on the same here? I think if `ifNode.expr.narrowedTy... | public void visit(BLangIf ifNode) {
typeChecker.checkExpr(ifNode.expr, env, symTable.booleanType);
BType actualType = ifNode.expr.getBType();
if (TypeTags.TUPLE == actualType.tag) {
dlog.error(ifNode.expr.pos, DiagnosticErrorCode.INCOMPATIBLE_TYPES, symTable.booleanType, actualType);... | typeNarrower.addHigherEnvTypeNarrowedSymbols(ifEnv); | public void visit(BLangIf ifNode) {
typeChecker.checkExpr(ifNode.expr, env, symTable.booleanType);
BType actualType = ifNode.expr.getBType();
if (TypeTags.TUPLE == actualType.tag) {
dlog.error(ifNode.expr.pos, DiagnosticErrorCode.INCOMPATIBLE_TYPES, symTable.booleanType, actualType);... | class representing a service-decl or object-ctor with service prefix
AttachPoint.Point attachedPoint;
Set<Flag> flagSet = classDefinition.flagSet;
if (flagSet.contains(Flag.OBJECT_CTOR) && flagSet.contains(Flag.SERVICE)) {
attachedPoint = AttachPoint.Point.SERVICE;
} | class representing a service-decl or object-ctor with service prefix
AttachPoint.Point attachedPoint;
Set<Flag> flagSet = classDefinition.flagSet;
if (flagSet.contains(Flag.OBJECT_CTOR) && flagSet.contains(Flag.SERVICE)) {
attachedPoint = AttachPoint.Point.SERVICE;
} |
Then I'll keep the implementation as is. If the user passes in a null options object, we will send the current timestamp for them | Mono<Response<Void>> publishTelemetryWithResponse(String digitalTwinId, String messageId, Object payload, DigitalTwinsSendTelemetryOptions options, Context context) {
if (messageId == null || messageId.isEmpty()) {
messageId = UUID.randomUUID().toString();
}
com.azure.digitaltwins.c... | options.getTimestamp().toString(), | new DigitalTwinsSendTelemetryOptions();
protocolLayerOptions = null;
}
else {
protocolLayerOptions = new com.azure.digitaltwins.core.implementation.models.DigitalTwinsSendTelemetryOptions()
.setTraceparent(options.getTraceparent())
.setTracestate(o... | class such as {@link BasicDigitalTwin} | class such as {@link BasicDigitalTwin} |
Do you check whether the user specified partitions are all valid partitions? | private void updateCurrentKafkaPartitions() {
if (customKafkaPartitions == null || customKafkaPartitions.size() == 0) {
LOG.debug("All of partitions which belong to topic will be load for {} routine load job", name);
currentKafkaPartitions.addAll(getAllKafkaPartitions());
... | currentKafkaPartitions = customKafkaPartitions; | private void updateCurrentKafkaPartitions() {
if (customKafkaPartitions == null || customKafkaPartitions.size() == 0) {
LOG.debug("All of partitions which belong to topic will be loaded for {} routine load job", name);
currentKafkaPartitions.addAll(getAllKafkaPartitions());
... | class KafkaRoutineLoadJob extends RoutineLoadJob {
private static final Logger LOG = LogManager.getLogger(KafkaRoutineLoadJob.class);
private static final String FE_GROUP_ID = "fe_fetch_partitions";
private static final int FETCH_PARTITIONS_TIMEOUT = 10;
private String serverAddress;
private Strin... | class KafkaRoutineLoadJob extends RoutineLoadJob {
private static final Logger LOG = LogManager.getLogger(KafkaRoutineLoadJob.class);
private static final String FE_GROUP_ID = "fe_fetch_partitions";
private static final int FETCH_PARTITIONS_TIMEOUT = 10;
private String serverAddress;
private Strin... |
Can `jMethodRequest.bReturnType` have an error type? If so, this can lead to multiple `error` in the diagnostic message. | private void validateExceptionTypes(JMethodRequest jMethodRequest, JMethod jMethod) {
Executable method = jMethod.getMethod();
boolean throwsCheckedException = false;
boolean returnsErrorValue;
try {
for (Class<?> exceptionType : method.getExceptionTypes()) {
... | "': expected '" + jMethodRequest.bReturnType + "|error', found '" + | private void validateExceptionTypes(JMethodRequest jMethodRequest, JMethod jMethod) {
Executable method = jMethod.getMethod();
boolean throwsCheckedException = false;
boolean returnsErrorValue;
try {
for (Class<?> exceptionType : method.getExceptionTypes()) {
... | class names for each parameter " +
"with 'paramTypes' field in the annotation");
}
}
JMethod jMethod = resolveExactMethod(jMethodRequest.declaringClass, jMethodRequest.methodName,
jMethodRequest.kind, jMethodRequest.paramTypeConstraints, jMeth... | class names for each parameter " +
"with 'paramTypes' field in the annotation");
}
}
JMethod jMethod = resolveExactMethod(jMethodRequest.declaringClass, jMethodRequest.methodName,
jMethodRequest.kind, jMethodRequest.paramTypeConstraints, jMeth... |
"What if we need to set up/create an object on the service first (as part of the arrange), before acting on it? Do we initialize the sync client too, and use it to arrange the setup? Or do we use a multi…" you can chain multiple service calls asynchronously through Reactor operators like then().. so, the first call wi... | public void canGetExistingChatThread() {
CreateChatThreadOptions threadRequest = ChatOptionsProvider.createThreadOptions(
firstThreadMember.getId(), secondThreadMember.getId());
ChatThreadAsyncClient chatThreadClient = client.createChatThread(threadRequest).block();
... | ChatThreadAsyncClient chatThreadClient = client.createChatThread(threadRequest).block(); | public void canGetExistingChatThread() {
CreateChatThreadOptions threadRequest = ChatOptionsProvider.createThreadOptions(
firstThreadMember.getId(), secondThreadMember.getId());
AtomicReference<ChatThreadAsyncClient> chatThreadClientRef = new AtomicReference<>();
S... | class ChatAsyncClientTest extends ChatClientTestBase {
private ClientLogger logger = new ClientLogger(ChatClientTest.class);
private CommunicationIdentityClient communicationClient;
private ChatAsyncClient client;
private CommunicationUser firstThreadMember;
private CommunicationUser secondThread... | class ChatAsyncClientTest extends ChatClientTestBase {
private ClientLogger logger = new ClientLogger(ChatClientTest.class);
private CommunicationIdentityClient communicationClient;
private ChatAsyncClient client;
private CommunicationUser firstThreadMember;
private CommunicationUser secondThread... |
Why does the outerSchema need to be nullable here? | public void testParameterStruct() {
String sql = "SELECT @p as ColA";
ImmutableMap<String, Value> params =
ImmutableMap.of(
"p",
Value.createStructValue(
TypeFactory.createStructType(
ImmutableList.of(
new StructType.Str... | Schema.builder().addNullableField("field1", FieldType.row(innerSchema)).build(); | public void testParameterStruct() {
String sql = "SELECT @p as ColA";
ImmutableMap<String, Value> params =
ImmutableMap.of(
"p",
Value.createStructValue(
TypeFactory.createStructType(
ImmutableList.of(
new StructType.Str... | class ZetaSQLDialectSpecTest {
private static final Long PIPELINE_EXECUTION_WAITTIME_MINUTES = 2L;
private FrameworkConfig config;
private TableProvider tableProvider;
@Rule public transient TestPipeline pipeline = TestPipeline.create();
@Rule public ExpectedException thrown = ExpectedException.none();
... | class ZetaSQLDialectSpecTest {
private static final Long PIPELINE_EXECUTION_WAITTIME_MINUTES = 2L;
private FrameworkConfig config;
private TableProvider tableProvider;
@Rule public transient TestPipeline pipeline = TestPipeline.create();
@Rule public ExpectedException thrown = ExpectedException.none();
... |
What would happened if `element == null`? | public void serialize(Set<T> set, DataOutputView target) throws IOException {
final int size = set.size();
target.writeInt(size);
for (T element : set) {
elementSerializer.serialize(element, target);
}
} | elementSerializer.serialize(element, target); | public void serialize(Set<T> set, DataOutputView target) throws IOException {
final int size = set.size();
target.writeInt(size);
for (T element : set) {
if (element == null) {
target.writeBoolean(true);
} else {
target.writeBoolean(false);... | class SetSerializer<T> extends TypeSerializer<Set<T>> {
private static final long serialVersionUID = 1L;
/** The serializer for the elements of the set. */
private final TypeSerializer<T> elementSerializer;
/**
* Creates a set serializer that uses the given serializer to serialize the set's elem... | class SetSerializer<T> extends TypeSerializer<Set<T>> {
private static final long serialVersionUID = 1L;
/** The serializer for the elements of the set. */
private final TypeSerializer<T> elementSerializer;
/**
* Creates a set serializer that uses the given serializer to serialize the set's elem... |
@zentol Thank you very much for the good catch. I'm so sorry for the rookie mistake. I'll check it carefully | void testNonCoordinationMode() throws Exception {
assertThat(OperatingSystem.isLinux()).isTrue();
testExistWithNonZero("test_non_coordination_mode");
} | assertThat(OperatingSystem.isLinux()).isTrue(); | void testNonCoordinationMode() throws Exception {
assumeThat(OperatingSystem.isLinux()).isTrue();
testExistWithNonZero("test_non_coordination_mode");
} | class GPUDiscoveryScriptTest {
private static final String TEST_SCRIPT_PATH = "src/test/resources/test-coordination-mode.sh";
@Test
@Test
void testCoordinateIndexes() throws Exception {
assertThat(OperatingSystem.isLinux()).isTrue();
testExistWithNonZero("test_coordinate_indexes"... | class GPUDiscoveryScriptTest {
private static final String TEST_SCRIPT_PATH = "src/test/resources/test-coordination-mode.sh";
@Test
@Test
void testCoordinateIndexes() throws Exception {
assumeThat(OperatingSystem.isLinux()).isTrue();
testExistWithNonZero("test_coordinate_indexes"... |
Maybe it's a stupid question but you don't want to support the gzip providers in the REST client case? It would probably be nice to support it too, no? I think what is done in the server part indeed also considers the client case so I would just put that code in resteasy-common. And this particular config item would b... | public void register(RegistrationContext registrationContext) {
for (Map.Entry<DotName, ClassInfo> entry : interfaces.entrySet()) {
BeanConfigurator<Object> configurator = registrationContext.configure(entry.getKey());
configurator.addType(ent... | m.returnValue(ret); | public void register(RegistrationContext registrationContext) {
for (Map.Entry<DotName, ClassInfo> entry : interfaces.entrySet()) {
BeanConfigurator<Object> configurator = registrationContext.configure(entry.getKey());
configurator.addType(ent... | class SmallRyeRestClientProcessor {
private static final DotName REST_CLIENT = DotName.createSimple(RestClient.class.getName());
private static final DotName PATH = DotName.createSimple(Path.class.getName());
private static final String PROVIDERS_SERVICE_FILE = "META-INF/services/" + Providers.class.getN... | class SmallRyeRestClientProcessor {
private static final DotName REST_CLIENT = DotName.createSimple(RestClient.class.getName());
private static final DotName PATH = DotName.createSimple(Path.class.getName());
private static final String PROVIDERS_SERVICE_FILE = "META-INF/services/" + Providers.class.getN... |
Surprisingly, it turns out the service actually will accept `x-ms-client-request-id` if `client-request-id` is not provided. This must be a case of the service having changed after this part of the Track 1 .NET SDK was written. We can remove this special case whenever is convenient (perhaps before GA). | public SearchIndexAsyncClient buildAsyncClient() {
policies.add(new AddHeadersPolicy(headers));
policies.add(new RequestIdPolicy("client-request-id"));
policies.add(new AddDatePolicy());
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPo... | policies.add(new RequestIdPolicy("client-request-id")); | public SearchIndexAsyncClient buildAsyncClient() {
policies.add(new AddHeadersPolicy(headers));
policies.add(new RequestIdPolicy("client-request-id"));
policies.add(new AddDatePolicy());
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPo... | class SearchIndexClientBuilder {
private static final String ECHO_REQUEST_ID_HEADER = "x-ms-return-client-request-id";
private static final String SEARCH_PROPERTIES = "azure-search.properties";
private static final String NAME = "name";
private static final String VERSION = "version";
S... | class SearchIndexClientBuilder {
private static final String ECHO_REQUEST_ID_HEADER = "x-ms-return-client-request-id";
private static final String SEARCH_PROPERTIES = "azure-search.properties";
private static final String NAME = "name";
private static final String VERSION = "version";
S... |
yes, I think we should remove those, I had similar thought a few weeks ago but got distracted from opening PR 😓: https://github.com/trask/azure-sdk-for-java/commit/af44c693a9e4bbf1013857ec34724a3412216d0f | private void end(int statusCode, Throwable throwable, Context context) {
if (throwable != null) {
if (statusCode == HttpConstants.StatusCodes.NOTFOUND) {
tracer.setAttribute(TracerProvider.ERROR_MSG, "Not found exception", context);
tracer.setAttribute(TracerProvider.... | tracer.setAttribute(TracerProvider.ERROR_MSG, throwable.getMessage(), context); | private void end(int statusCode, Throwable throwable, Context context) {
if (throwable != null) {
if (throwable instanceof CosmosException) {
CosmosException cosmosException = (CosmosException) throwable;
if (statusCode == HttpConstants.StatusCodes.NOTFOUND && cosmosE... | class TracerProvider {
private Tracer tracer;
private static final Logger LOGGER = LoggerFactory.getLogger(TracerProvider.class);
private static final ObjectMapper mapper = new ObjectMapper();
private final static String JSON_STRING = "JSON";
public final static String DB_TYPE_VALUE = "Cosmos";
... | class TracerProvider {
private Tracer tracer;
private static final Logger LOGGER = LoggerFactory.getLogger(TracerProvider.class);
private static final ObjectMapper mapper = new ObjectMapper();
private final static String JSON_STRING = "JSON";
public final static String DB_TYPE_VALUE = "Cosmos";
... |
A switch will be more efficient since if it's TUPLE_VARIABLE_REF, it have to check 4 if-checks | private void checkDuplicateVarRefs(List<BLangExpression> varRefs, Set<BSymbol> symbols) {
for (BLangExpression varRef : varRefs) {
NodeKind kind = varRef.getKind();
if (kind == NodeKind.SIMPLE_VARIABLE_REF) {
BLangSimpleVarRef simpleVarRef = (BLangSimpleVarRef) varRef;
... | if (kind == NodeKind.SIMPLE_VARIABLE_REF) { | private void checkDuplicateVarRefs(List<BLangExpression> varRefs, Set<BSymbol> symbols) {
for (BLangExpression varRef : varRefs) {
NodeKind kind = varRef.getKind();
switch (kind) {
case SIMPLE_VARIABLE_REF:
BLangSimpleVarRef simpleVarRef = (BLangSimple... | class CodeAnalyzer extends SimpleBLangNodeAnalyzer<CodeAnalyzer.AnalyzerData> {
private static final CompilerContext.Key<CodeAnalyzer> CODE_ANALYZER_KEY =
new CompilerContext.Key<>();
private final SymbolResolver symResolver;
private final SymbolTable symTable;
private final Types types;
... | class CodeAnalyzer extends SimpleBLangNodeAnalyzer<CodeAnalyzer.AnalyzerData> {
private static final CompilerContext.Key<CodeAnalyzer> CODE_ANALYZER_KEY =
new CompilerContext.Key<>();
private final SymbolResolver symResolver;
private final SymbolTable symTable;
private final Types types;
... |
Cool - that makes sense, thanks. Just wanted to make sure we weren't changing for a failing test. | public void shouldNotDetectClassPathResourceThatIsNotAFile() throws Exception {
String url = "http:
ClassLoader classLoader = new URLClassLoader(new URL[] {new URL(url)});
ClasspathScanningResourcesDetector detector =
new ClasspathScanningResourcesDetector(new ClassGraph());
List<String> result... | String url = "http: | public void shouldNotDetectClassPathResourceThatIsNotAFile() throws Exception {
String url = "http:
ClassLoader classLoader = new URLClassLoader(new URL[] {new URL(url)});
ClasspathScanningResourcesDetector detector =
new ClasspathScanningResourcesDetector(new ClassGraph());
List<String> result... | class ClasspathScanningResourcesDetectorTest {
@Rule public transient TemporaryFolder tmpFolder = new TemporaryFolder();
@Rule public transient RestoreSystemProperties systemProperties = new RestoreSystemProperties();
@Test
public void shouldDetectDirectories() throws Exception {
File folder = tmpFolder.... | class ClasspathScanningResourcesDetectorTest {
@Rule public transient TemporaryFolder tmpFolder = new TemporaryFolder();
@Rule public transient RestoreSystemProperties systemProperties = new RestoreSystemProperties();
@Test
public void shouldDetectDirectories() throws Exception {
File folder = tmpFolder.... |
@kushagraThapar https://github.com/Azure/azure-sdk-for-java/issues/9053 is for the PartitionKey.None is that right link? | public static void validateAndRemoveSessionToken(RxDocumentServiceRequest request) {
String sessionToken = request.getHeaders().get(HttpConstants.HttpHeaders.SESSION_TOKEN);
if (!Strings.isNullOrEmpty(sessionToken)) {
String partitionKeyRangeId = request.requestContext.resolvedPartitionKeyRa... | String partitionKeyRangeId = request.requestContext.resolvedPartitionKeyRange.getId(); | public static void validateAndRemoveSessionToken(RxDocumentServiceRequest request) {
String sessionToken = request.getHeaders().get(HttpConstants.HttpHeaders.SESSION_TOKEN);
if (!Strings.isNullOrEmpty(sessionToken)) {
getLocalSessionToken(request, sessionToken, StringUtils.EMPTY);
... | class SessionTokenHelper {
public static void setOriginalSessionToken(RxDocumentServiceRequest request, String originalSessionToken) {
if (request == null) {
throw new IllegalArgumentException("request is null");
}
if (originalSessionToken == null) {
request.getHead... | class SessionTokenHelper {
public static void setOriginalSessionToken(RxDocumentServiceRequest request, String originalSessionToken) {
if (request == null) {
throw new IllegalArgumentException("request is null");
}
if (originalSessionToken == null) {
request.getHead... |
@soulasuna Can you add some sql parse test case for this logic? | public ASTNode visitSet(final SetContext ctx) {
PostgreSQLSetStatement result = new PostgreSQLSetStatement();
Collection<VariableAssignSegment> variableAssigns = new LinkedList<>();
if (null != ctx.configurationParameterClause()) {
VariableAssignSegment variableAssignSegment = (Varia... | result.getVariableAssigns().addAll(variableAssigns); | public ASTNode visitSet(final SetContext ctx) {
PostgreSQLSetStatement result = new PostgreSQLSetStatement();
Collection<VariableAssignSegment> variableAssigns = new LinkedList<>();
if (null != ctx.configurationParameterClause()) {
VariableAssignSegment variableAssignSegment = (Varia... | class PostgreSQLDALStatementSQLVisitor extends PostgreSQLStatementSQLVisitor implements DALSQLVisitor, SQLStatementVisitor {
public PostgreSQLDALStatementSQLVisitor(final Properties props) {
super(props);
}
@Override
public ASTNode visitShow(final ShowContext ctx) {
return new ... | class PostgreSQLDALStatementSQLVisitor extends PostgreSQLStatementSQLVisitor implements DALSQLVisitor, SQLStatementVisitor {
public PostgreSQLDALStatementSQLVisitor(final Properties props) {
super(props);
}
@Override
public ASTNode visitShow(final ShowContext ctx) {
return new ... |
@Ladicek we wanted to know if ClassInfo.annotations(annotation) orders the result the same as when you loop over ClassInfo.fields(). If so I can improve the code without introducing a breaking change. If not I will have to keep it like this. @FroMage Is there a way we can have users migrate to the new RestLinkId anno... | private FieldInfo resolveField(IndexView index, String parameterName, DotName className) {
FieldInfoSupplier byParamName = new FieldInfoSupplier(c -> c.field(parameterName), className, index);
FieldInfo fieldInfo = byParamName.get();
if (parameterName.equals("id")) {
... | for (FieldInfo field : c.fields()) { | private FieldInfo resolveField(IndexView index, String parameterName, DotName className) {
FieldInfoSupplier byParamName = new FieldInfoSupplier(c -> c.field(parameterName), className, index);
FieldInfo fieldInfo = byParamName.get();
if (parameterName.equals("id")) {
... | class that knows how to access that getter method to avoid using reflection later.
*/
private RuntimeValue<GetterAccessorsContainer> implementPathParameterValueGetters(IndexView index,
ClassOutput classOutput, LinksContainer linksContainer,
GetterAccessorsContainerRecorder getterAccesso... | class that knows how to access that getter method to avoid using reflection later.
*/
private RuntimeValue<GetterAccessorsContainer> implementPathParameterValueGetters(IndexView index,
ClassOutput classOutput, LinksContainer linksContainer,
GetterAccessorsContainerRecorder getterAccesso... |
Is the Toml location correct ? Shall we validate the location is the test as well ? | public void testPkgInvalidExportedModule() {
Package currentPackage = loadPackage("package_invalid_exported_modules");
DiagnosticResult diagnosticResult = currentPackage.getCompilation().diagnosticResult();
Assert.assertEquals(diagnosticResult.diagnosticCount(), 3, "Unexpected number of compilat... | Assert.assertEquals(diagnosticIterator.next().toString(), "ERROR [Ballerina.toml:(4:10,4:15)] " | public void testPkgInvalidExportedModule() {
Package currentPackage = loadPackage("package_invalid_exported_modules");
DiagnosticResult diagnosticResult = currentPackage.getCompilation().diagnosticResult();
Assert.assertEquals(diagnosticResult.diagnosticCount(), 3, "Unexpected number of compilat... | class CompilerPluginTests {
private static final Path RESOURCE_DIRECTORY = Paths.get(
"src/test/resources/compiler_plugin_tests").toAbsolutePath();
private static final PrintStream OUT = System.out;
@BeforeSuite
public void init() {
BCompileUtil.compileAndCacheBala("compiler_plugin_... | class CompilerPluginTests {
private static final Path RESOURCE_DIRECTORY = Paths.get(
"src/test/resources/compiler_plugin_tests").toAbsolutePath();
private static final PrintStream OUT = System.out;
@BeforeSuite
public void init() {
BCompileUtil.compileAndCacheBala("compiler_plugin_... |
Added it to constructor and left a comment to explain why we do that check. | public void setIndex(int index) {
if (this.index == 0) {
this.index = index;
}
} | if (this.index == 0) { | public void setIndex(int index) {
if (this.index == 0) {
this.index = index;
}
} | class ItemBulkOperation<TInternal, TContext> extends CosmosItemOperationBase implements Comparable<CosmosItemOperation> {
private final TInternal item;
private final TContext context;
private final String id;
private final PartitionKey partitionKey;
private final CosmosItemOperationType operationTy... | class ItemBulkOperation<TInternal, TContext> extends CosmosItemOperationBase implements Comparable<CosmosItemOperation> {
private final TInternal item;
private final TContext context;
private final String id;
private final PartitionKey partitionKey;
private final CosmosItemOperationType operationTy... |
Doesn't `QuerySpecification` have fluent setters? | Mono<PagedResponse<String>> queryFirstPage(String query, Context context) {
QuerySpecification querySpecification = new QuerySpecification();
querySpecification
.setQuery(query);
return protocolLayer
.getQueries()
.queryTwinsWithResponseAsync(querySpecificat... | querySpecification | new QuerySpecification().setQuery(query);
return protocolLayer
.getQueries()
.queryTwinsWithResponseAsync(querySpecification, context)
.map(objectPagedResponse -> new PagedResponseBase<>(
objectPagedResponse.getRequest(),
objectPagedResponse.g... | class to convert the query response to.
* @param <T> The generic type to convert the query response to.
* @return A {@link PagedFlux} | class to convert the query response to.
* @param <T> The generic type to convert the query response to.
* @return A {@link PagedFlux} |
throw new NumberFormatException("invalid id: " + id); | public static TUniqueId parseTUniqueIdFromString(String id) {
if (Strings.isNullOrEmpty(id)) {
throw new NumberFormatException("invalid query id");
}
String[] parts = id.split("-");
if (parts.length != 2) {
throw new NumberFormatException("invalid query id");
... | throw new NumberFormatException("invalid query id"); | public static TUniqueId parseTUniqueIdFromString(String id) {
if (Strings.isNullOrEmpty(id)) {
throw new NumberFormatException("invalid query id");
}
String[] parts = id.split("-");
if (parts.length != 2) {
throw new NumberFormatException("invalid query id");
... | class DebugUtil {
public static final DecimalFormat DECIMAL_FORMAT_SCALE_3 = new DecimalFormat("0.000");
public static int THOUSAND = 1000;
public static int MILLION = 1000 * THOUSAND;
public static int BILLION = 1000 * MILLION;
public static int SECOND = 1000;
public static int MINUTE = 60 *... | class DebugUtil {
public static final DecimalFormat DECIMAL_FORMAT_SCALE_3 = new DecimalFormat("0.000");
public static int THOUSAND = 1000;
public static int MILLION = 1000 * THOUSAND;
public static int BILLION = 1000 * MILLION;
public static int SECOND = 1000;
public static int MINUTE = 60 *... |
I got a PR on https://github.com/geoand/quarkus/pull/1 but for right padding but for some reason that gives me a NPE in the java compiler ;) | private String readBannerFile(BannerConfig config) {
URL resource = Thread.currentThread().getContextClassLoader().getResource(config.path);
if (resource != null) {
try (InputStream is = resource.openStream()) {
byte[] content = FileUtil.readFileContents(is);
... | bannerTitle.append("Powered by Quarkus v").append(Version.getVersion()).append('\n'); | private String readBannerFile(BannerConfig config) {
try {
Map.Entry<URL, Boolean> entry = getBanner(config);
URL bannerResourceURL = entry.getKey();
if (bannerResourceURL == null) {
logger.warn("Could not locate banner file");
return "";
... | class })
@Record(ExecutionTime.RUNTIME_INIT)
public ConsoleFormatterBannerBuildItem recordBanner(BannerRecorder recorder, BannerConfig config,
BannerRuntimeConfig bannerRuntimeConfig) {
String bannerText = readBannerFile(config);
return new ConsoleFormatterBannerBuildItem(recorder.pr... | class })
@Record(ExecutionTime.RUNTIME_INIT)
public ConsoleFormatterBannerBuildItem recordBanner(BannerRecorder recorder, BannerConfig config,
BannerRuntimeConfig bannerRuntimeConfig) {
String bannerText = readBannerFile(config);
return new ConsoleFormatterBannerBuildItem(recorder.pr... |
```suggestion return cosmosItem; ``` on this if branch the item is InternalObjectNode you don't need to serialze and deserialize again. | public static InternalObjectNode fromObjectToInternalObjectNode(Object cosmosItem) {
if (cosmosItem instanceof InternalObjectNode) {
return new InternalObjectNode(((InternalObjectNode) cosmosItem).toJson());
} else if (cosmosItem instanceof byte[]) {
return new InternalObjectNode... | return new InternalObjectNode(((InternalObjectNode) cosmosItem).toJson()); | public static InternalObjectNode fromObjectToInternalObjectNode(Object cosmosItem) {
if (cosmosItem instanceof InternalObjectNode) {
return (InternalObjectNode) cosmosItem;
} else if (cosmosItem instanceof byte[]) {
return new InternalObjectNode((byte[]) cosmosItem);
} el... | class InternalObjectNode extends Resource {
private static final ObjectMapper MAPPER = Utils.getSimpleObjectMapper();
/**
* Initialize an empty InternalObjectNode object.
*/
public InternalObjectNode() {
}
/**
* Initialize a InternalObjectNode object from json string.
*
*... | class InternalObjectNode extends Resource {
private static final ObjectMapper MAPPER = Utils.getSimpleObjectMapper();
/**
* Initialize an empty InternalObjectNode object.
*/
public InternalObjectNode() {
}
/**
* Initialize a InternalObjectNode object from json string.
*
*... |
So I see why we support the capability to point to another jar but I don't see why we need to support this case? Could you explain it to me? Thanks! | public void execute() throws MojoExecutionException, MojoFailureException {
if (project.getPackaging().equals("pom") && appArtifact == null) {
getLog().info("Type of the artifact is POM and appArtifact parameter has not been set, skipping native-image goal");
return;
}
... | appMvnArtifact.getVersion()); | public void execute() throws MojoExecutionException, MojoFailureException {
if (project.getPackaging().equals("pom") && appArtifact == null) {
getLog().info("Type of the artifact is POM and appArtifact parameter has not been set, skipping native-image goal");
return;
}
... | class NativeImageMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
protected MavenProject project;
@Parameter(defaultValue = "${project.build.directory}")
private File buildDir;
/**
* The directory for compiled classes.
*/
@Paramet... | class NativeImageMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
protected MavenProject project;
@Parameter(defaultValue = "${project.build.directory}")
private File buildDir;
/**
* The directory for compiled classes.
*/
@Paramet... |
Since this is a negative test case, add `-negative` part to the file name. | public void testParseMainFuncWithoutName() {
CompileResult result = BCompileUtil.compile("test-src/parser/func-without-name-negative.bal");
BAssertUtil.validateError(result, 0, "mismatched input '{'. expecting {'[', '?', '|', Identifier}", 1, 30);
BAssertUtil.validateError(result, 1, "mismatched... | CompileResult result = BCompileUtil.compile("test-src/parser/listener-declaration-without-type.bal"); | public void testParseMainFuncWithoutName() {
CompileResult result = BCompileUtil.compile("test-src/parser/func-without-name-negative.bal");
BAssertUtil.validateError(result, 0, "mismatched input '{'. expecting {'[', '?', '|', Identifier}", 1, 30);
BAssertUtil.validateError(result, 1, "mismatched... | class InvalidSyntaxParserTest {
/**
* Test missing expected syntax.
*/
@Test
public void testParseSemicolonMissingService() {
CompileResult result = BCompileUtil.compile("test-src/parser/semicolon-missing-service-negative.bal");
BAssertUtil.validateError(result, 0, "invalid token... | class InvalidSyntaxParserTest {
/**
* Test missing expected syntax.
*/
@Test
public void testParseSemicolonMissingService() {
CompileResult result = BCompileUtil.compile("test-src/parser/semicolon-missing-service-negative.bal");
BAssertUtil.validateError(result, 0, "invalid token... |
Comma should be at the end of the previous line. | public void testPullCount() throws IOException {
URI remoteUri = URI.create(RepoUtils.getRemoteRepoURL() + "/modules/info/" + orgName + "/" + moduleName);
HttpURLConnection conn;
conn = (HttpURLConnection) remoteUri.toURL().openConnection();
int statusCode = conn.getResponseCode();
... | , Charset.defaultCharset()))) { | public void testPullCount() throws IOException {
URI remoteUri = URI.create(RepoUtils.getStagingURL() + "/modules/info/" + orgName + "/" + moduleName + "/*/");
HttpURLConnection conn;
conn = (HttpURLConnection) remoteUri.toURL().openConnection();
int statusCode = conn.getResponseCode();
... | class PackagingTestCase extends BaseTest {
private Path tempHomeDirectory;
private Path tempProjectDirectory;
private String moduleName = "test";
private String datePushed;
private String orgName = "bcintegrationtest";
private Map<String, String> envVariables;
private BMainInstance balClient... | class PackagingTestCase extends BaseTest {
private Path tempHomeDirectory;
private Path tempProjectDirectory;
private String moduleName = "test";
private String datePushed;
private String orgName = "bcintegrationtest";
private Map<String, String> envVariables;
private BMainInstance balClient... |
Yes. My next pr will fix it. | public void testInClauseCombineOr_2() throws Exception {
String plan = getFragmentPlan("select * from ptest where (d2 > '1000-01-01') or (d2 in (null, null));");
assertTrue(plan.contains(" 0:OlapScanNode\n" +
" TABLE: ptest\n" +
" PREAGGREGATION: ON\n" +
... | " PREDICATES: (2: d2 > '1000-01-01') OR (2: d2 IN (NULL, NULL)), 2: d2 > '1000-01-01'\n" + | public void testInClauseCombineOr_2() throws Exception {
String plan = getFragmentPlan("select * from ptest where (d2 > '1000-01-01') or (d2 in (null, null));");
assertTrue(plan.contains(" 0:OlapScanNode\n" +
" TABLE: ptest\n" +
" PREAGGREGATION: ON\n" +
... | class PartitionPruneTest extends PlanTestBase {
@BeforeClass
public static void beforeClass() throws Exception {
PlanTestBase.beforeClass();
FeConstants.runningUnitTest = true;
starRocksAssert.withTable("CREATE TABLE `ptest` (\n"
+ " `k1` int(11) NOT NULL COMMENT \"\",\n... | class PartitionPruneTest extends PlanTestBase {
@BeforeClass
public static void beforeClass() throws Exception {
PlanTestBase.beforeClass();
FeConstants.runningUnitTest = true;
starRocksAssert.withTable("CREATE TABLE `ptest` (\n"
+ " `k1` int(11) NOT NULL COMMENT \"\",\n... |
It uses the original HTTP headers, not the ones that filters can add to. At some point this needs to be cleaned up, but not today :) | public void write(ResteasyReactiveRequestContext context, Object entity) throws IOException {
EncodedMediaType producesMediaType = context.getResponseContentType();
MessageBodyWriter<?>[] writers = null;
MediaType serverSerializersMediaType = null;
if (producesMediaType == null) {
... | negotiatedMediaType = producesServerMediaType | public void write(ResteasyReactiveRequestContext context, Object entity) throws IOException {
EncodedMediaType producesMediaType = context.getResponseContentType();
MessageBodyWriter<?>[] writers = null;
MediaType serverSerializersMediaType = null;
if (producesMediaType == null) {
... | class DynamicEntityWriter implements EntityWriter {
private static final MessageBodyWriter<?>[] EMPTY_ARRAY = new MessageBodyWriter[0];
private final ServerSerialisers serialisers;
public DynamicEntityWriter(ServerSerialisers serialisers) {
this.serialisers = serialisers;
}
@Override
... | class DynamicEntityWriter implements EntityWriter {
private static final MessageBodyWriter<?>[] EMPTY_ARRAY = new MessageBodyWriter[0];
private final ServerSerialisers serialisers;
public DynamicEntityWriter(ServerSerialisers serialisers) {
this.serialisers = serialisers;
}
@Override
... |
> Is the documentation of the sql client outdated? It doesn't list --update Not outdated, the --update is used to execute one SQL statement in the client, such as: ``` ./bin/sql-client.sh embedded --jar test.jar -u "select 1" ``` > and embedded does not appear to be an optional argument. That's true, now it's a ne... | public void submitSQLJob(SQLJobSubmission job) throws IOException {
final List<String> commands = new ArrayList<>();
commands.add(bin.resolve("sql-client.sh").toAbsolutePath().toString());
if (job.isEmbedded()) {
commands.add("embedded");
}
if (job.getDefaultEnvFile() != null) {
commands.add("--defaults... | commands.add(jar); | public void submitSQLJob(SQLJobSubmission job) throws IOException {
final List<String> commands = new ArrayList<>();
commands.add(bin.resolve("sql-client.sh").toAbsolutePath().toString());
commands.add("embedded");
job.getDefaultEnvFile().ifPresent(defaultEnvFile -> {
commands.add("--defaults");
commands.... | class FlinkDistribution implements ExternalResource {
private static final Logger LOG = LoggerFactory.getLogger(FlinkDistribution.class);
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private final Path logBackupDir;
private final TemporaryFolder temporaryFolder = new TemporaryFolder();
... | class FlinkDistribution implements ExternalResource {
private static final Logger LOG = LoggerFactory.getLogger(FlinkDistribution.class);
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private final Path logBackupDir;
private final TemporaryFolder temporaryFolder = new TemporaryFolder();
... |
That's what I had there originally, but since some pieces of code just choose to "silently" proceed now, WARN felt a bit too strong. But I wouldn't mind... | private static ClassInfo lookupClassInIndex(IndexView index, DotName dotName, boolean withLogging) {
if (dotName == null) {
throw new IllegalArgumentException("Cannot lookup class, provided DotName was null.");
}
if (index == null) {
throw new IllegalArgumentException("Ca... | LOGGER.info("Class for name: " + dotName + " was not found in Jandex index. Please ensure the class " + | private static ClassInfo lookupClassInIndex(IndexView index, DotName dotName, boolean withLogging) {
if (dotName == null) {
throw new IllegalArgumentException("Cannot lookup class, provided DotName was null.");
}
if (index == null) {
throw new IllegalArgumentException("Ca... | class IndexClassLookupUtils {
private static final Logger LOGGER = Logger.getLogger(IndexClassLookupUtils.class);
private IndexClassLookupUtils() {
}
public static ClassInfo getClassByName(IndexView index, DotName dotName) {
return lookupClassInIndex(index, dotName, true);
}
/**
... | class IndexClassLookupUtils {
private static final Logger LOGGER = Logger.getLogger(IndexClassLookupUtils.class);
private IndexClassLookupUtils() {
}
static ClassInfo getClassByName(IndexView index, DotName dotName) {
return lookupClassInIndex(index, dotName, true);
}
/**
* Used... |
why use AtomicReference<Long> instead of long here? | public static void write(File imageFile, Catalog catalog) throws IOException {
LOG.info("start save image to {}. is ckpt: {}", imageFile.getAbsolutePath(), Catalog.isCheckpointThread());
final AtomicReference<Long> checksum = new AtomicReference<>(0L);
long saveImageStartTime = System.... | final AtomicReference<Long> checksum = new AtomicReference<>(0L); | public static void write(File imageFile, Catalog catalog) throws IOException {
LOG.info("start save image to {}. is ckpt: {}", imageFile.getAbsolutePath(), Catalog.isCheckpointThread());
final Reference<Long> checksum = new Reference<>(0L);
long saveImageStartTime = System.currentTimeM... | class MetaWriter {
private static final Logger LOG = LogManager.getLogger(MetaWriter.class);
public static MetaWriter writer = new MetaWriter();
private interface Delegate {
long doWork(String name, WriteMethod method) throws IOException;
}
private interface WriteMethod {
long wri... | class MetaWriter {
private static final Logger LOG = LogManager.getLogger(MetaWriter.class);
public static MetaWriter writer = new MetaWriter();
private interface Delegate {
long doWork(String name, WriteMethod method) throws IOException;
}
private interface WriteMethod {
long wri... |
```suggestion for (String conditionalDep : conditionalDeps.split("\\s+")) { ``` | private ExtensionDependency loadExtensionInfo(Path descriptorPath, ModuleVersionIdentifier exentionId) {
final Properties extensionProperties = new Properties();
try (BufferedReader reader = Files.newBufferedReader(descriptorPath)) {
extensionProperties.load(reader);
} catch (IOExcep... | for (String conditionalDep : conditionalDeps.split(" ")) { | private ExtensionDependency loadExtensionInfo(Path descriptorPath, ModuleVersionIdentifier exentionId) {
final Properties extensionProperties = new Properties();
try (BufferedReader reader = Files.newBufferedReader(descriptorPath)) {
extensionProperties.load(reader);
} catch (IOExcep... | class ConditionalDependenciesEnabler {
private final Map<String, ExtensionDependency> featureVariants = new HashMap<>();
private final Project project;
public ConditionalDependenciesEnabler(Project project) {
this.project = project;
}
public Set<ExtensionDependency> declareConditionalDepe... | class ConditionalDependenciesEnabler {
private final Map<String, ExtensionDependency> featureVariants = new HashMap<>();
private final Project project;
public ConditionalDependenciesEnabler(Project project) {
this.project = project;
}
public Set<ExtensionDependency> declareConditionalDepe... |
We should probably pass the original exception as the `cause` | public ReactiveMongoCollection mongoCollection(Class<?> entityClass) {
MongoEntity mongoEntity = entityClass.getAnnotation(MongoEntity.class);
ReactiveMongoDatabase database = mongoDatabase(mongoEntity);
if (mongoEntity != null) {
ReactiveMongoCollection collection = mongoEntity.coll... | throw new IllegalArgumentException("Illegal read preference " + mongoEntity.readPreference() | public ReactiveMongoCollection mongoCollection(Class<?> entityClass) {
MongoEntity mongoEntity = entityClass.getAnnotation(MongoEntity.class);
ReactiveMongoDatabase database = mongoDatabase(mongoEntity);
if (mongoEntity != null) {
ReactiveMongoCollection collection = mongoEntity.coll... | class ReactiveMongoOperations<QueryType, UpdateType> {
public final String ID = "_id";
private static final Logger LOGGER = Logger.getLogger(ReactiveMongoOperations.class);
private static final List<String> UPDATE_OPERATORS = Arrays.asList(
"$currentDate", "$inc", "$min", "$max", "$mul", "... | class ReactiveMongoOperations<QueryType, UpdateType> {
public final String ID = "_id";
private static final Logger LOGGER = Logger.getLogger(ReactiveMongoOperations.class);
private static final List<String> UPDATE_OPERATORS = Arrays.asList(
"$currentDate", "$inc", "$min", "$max", "$mul", "... |
Ugh. No, I had added that briefly when testing and completely missed it when I cleaned up. Removing now. | public Manager(DataflowWorkerHarnessOptions options, Collection<Capturable> capturables) {
try {
client = options.getDataflowClient();
} catch (Exception e) {
LOG.info("Failed to get dataflow client. Does not send debug capture data. ", e);
return;
}
JsonFactory datOther... | JsonFactory datOtherFactory = new JacksonFactory(); | public Manager(DataflowWorkerHarnessOptions options, Collection<Capturable> capturables) {
try {
client = options.getDataflowClient();
} catch (Exception e) {
LOG.info("Failed to get dataflow client. Does not send debug capture data. ", e);
return;
}
project = options.ge... | class Manager {
private final Object lock = new Object();
private final ObjectMapper mapper = new ObjectMapper();
private String project, job, host, region;
private Dataflow client = null;
private ScheduledExecutorService executor = null;
private Collection<Capturable> capturables;
private b... | class Manager {
private final Object lock = new Object();
private final ObjectMapper mapper = new ObjectMapper();
private String project, job, host, region;
private Dataflow client = null;
private ScheduledExecutorService executor = null;
private Collection<Capturable> capturables;
private b... |
I'll think of a better solution for 1.2. Unfortunately without this change, Kubernetes manifest generation for 1.1 was sort of broken | public KubernetesPortBuildItem kubernetes() {
int port = ConfigProvider.getConfig().getOptionalValue("quarkus.http.port", Integer.class).orElse(8080);
return new KubernetesPortBuildItem(port, "http");
} | int port = ConfigProvider.getConfig().getOptionalValue("quarkus.http.port", Integer.class).orElse(8080); | public KubernetesPortBuildItem kubernetes() {
int port = ConfigProvider.getConfig().getOptionalValue("quarkus.http.port", Integer.class).orElse(8080);
return new KubernetesPortBuildItem(port, "http");
} | class VertxHttpProcessor {
@BuildStep
HttpRootPathBuildItem httpRoot(HttpBuildTimeConfig httpBuildTimeConfig) {
return new HttpRootPathBuildItem(httpBuildTimeConfig.rootPath);
}
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
FilterBuildItem cors(CORSRecorder recorder, HttpConfiguration... | class VertxHttpProcessor {
@BuildStep
HttpRootPathBuildItem httpRoot(HttpBuildTimeConfig httpBuildTimeConfig) {
return new HttpRootPathBuildItem(httpBuildTimeConfig.rootPath);
}
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
FilterBuildItem cors(CORSRecorder recorder, HttpConfiguration... |
Maybe, but it's hard to check each type, so only support Number/String/Boolean type | public boolean checkCastTypeReduceAble(Type parent, Type child, Type grandChild) {
int parentSlotSize = parent.getTypeSize();
int childSlotSize = child.getTypeSize();
int grandChildSlotSize = grandChild.getTypeSize();
if (parent.isDecimalOfAnyVersion() || child.isDecimalOfAnyVersion() |... | if (!(parent.isNumericType() || parent.isStringType()) || | public boolean checkCastTypeReduceAble(Type parent, Type child, Type grandChild) {
int parentSlotSize = parent.getTypeSize();
int childSlotSize = child.getTypeSize();
int grandChildSlotSize = grandChild.getTypeSize();
if (parent.isDecimalOfAnyVersion() || child.isDecimalOfAnyVersion() |... | class ReduceCastRule extends TopDownScalarOperatorRewriteRule {
@Override
public ScalarOperator visitCastOperator(CastOperator operator, ScalarOperatorRewriteContext context) {
if (operator.getChild(0) instanceof CastOperator && checkCastTypeReduceAble(operator.getType(),
opera... | class ReduceCastRule extends TopDownScalarOperatorRewriteRule {
@Override
public ScalarOperator visitCastOperator(CastOperator operator, ScalarOperatorRewriteContext context) {
if (operator.getChild(0) instanceof CastOperator && checkCastTypeReduceAble(operator.getType(),
opera... |
```suggestion props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".misfireThreshold", "" + quartzSupport.getRuntimeConfig().misfireThreshold.toMillis()); ``` once the config item has been changed to a `Duration` time, we can convert it to long like this. | private Properties getSchedulerConfigurationProperties(QuartzSupport quartzSupport) {
Properties props = new Properties();
QuartzBuildTimeConfig buildTimeConfig = quartzSupport.getBuildTimeConfig();
props.put(StdSchedulerFactory.PROP_SCHED_INSTANCE_ID, "AUTO");
props.put("org.quartz.sche... | "" + quartzSupport.getRuntimeConfig().misfireThreshold); | private Properties getSchedulerConfigurationProperties(QuartzSupport quartzSupport) {
Properties props = new Properties();
QuartzBuildTimeConfig buildTimeConfig = quartzSupport.getBuildTimeConfig();
props.put(StdSchedulerFactory.PROP_SCHED_INSTANCE_ID, "AUTO");
props.put("org.quartz.sche... | class QuartzScheduler implements Scheduler {
private static final Logger LOGGER = Logger.getLogger(QuartzScheduler.class.getName());
private static final String INVOKER_KEY = "invoker";
private final org.quartz.Scheduler scheduler;
private final boolean enabled;
private final boolean startHalted;
... | class QuartzScheduler implements Scheduler {
private static final Logger LOGGER = Logger.getLogger(QuartzScheduler.class.getName());
private static final String INVOKER_KEY = "invoker";
private final org.quartz.Scheduler scheduler;
private final boolean enabled;
private final boolean startHalted;
... |
Could this be removed for a test in `azure-core`? | public void timeoutPolicy() {
final String key = "newKey";
final String value = "newValue";
connectionString = interceptorManager.isPlaybackMode()
? "Endpoint=http:
: Configuration.getGlobalConfiguration().get(AZURE_APPCONFIG_CONNECTION_STRING);
final C... | public void timeoutPolicy() {
final String key = "newKey";
final String value = "newValue";
connectionString = interceptorManager.isPlaybackMode()
? "Endpoint=http:
: Configuration.getGlobalConfiguration().get(AZURE_APPCONFIG_CONNECTION_STRING);
final C... | class ConfigurationClientBuilderTest extends TestBase {
private static final String AZURE_APPCONFIG_CONNECTION_STRING = "AZURE_APPCONFIG_CONNECTION_STRING";
private static final String DEFAULT_DOMAIN_NAME = ".azconfig.io";
private static final String NAMESPACE_NAME = "dummyNamespaceName";
private stati... | class ConfigurationClientBuilderTest extends TestBase {
private static final String AZURE_APPCONFIG_CONNECTION_STRING = "AZURE_APPCONFIG_CONNECTION_STRING";
private static final String DEFAULT_DOMAIN_NAME = ".azconfig.io";
private static final String NAMESPACE_NAME = "dummyNamespaceName";
private stati... | |
I've addressed your point regarding the early returns vs nesting. As for the `newState == desiredState`, this fails tests so I'd rather not use it. | 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... |
The old timeout was too long. | private void stopProcess(String id, Process process) {
if (process.isAlive()) {
LOG.debug("Attempting to stop process with id {}", id);
process.destroy();
long maxTimeToWait = 500;
try {
if (waitForProcessToDie(process, maxTimeToWait)) {
LOG.debug("Process for worker... | long maxTimeToWait = 500; | private void stopProcess(String id, Process process) {
if (process.isAlive()) {
LOG.debug("Attempting to stop process with id {}", id);
process.destroy();
long maxTimeToWait = 500;
try {
if (waitForProcessToDie(process, maxTimeToWait)) {
LOG.debug("Process for worker... | class RunningProcess {
private Process process;
RunningProcess(Process process) {
this.process = process;
}
/** Checks if the underlying process is still running. */
public void isAliveOrThrow() throws IllegalStateException {
if (!process.isAlive()) {
throw new IllegalStateExce... | class RunningProcess {
private Process process;
RunningProcess(Process process) {
this.process = process;
}
/** Checks if the underlying process is still running. */
public void isAliveOrThrow() throws IllegalStateException {
if (!process.isAlive()) {
throw new IllegalStateExce... |
ImmutableSet.copyOf(...) is likely faster, especially for sets of {0,1} elements. (Might be worth using elsewhere too.) | private StringSetResult getStringSetValue(MetricUpdate metricUpdate) {
if (metricUpdate.getSet() == null) {
return StringSetResult.empty();
}
return StringSetResult.create(new HashSet<>(((ArrayList) metricUpdate.getSet())));
} | return StringSetResult.create(new HashSet<>(((ArrayList) metricUpdate.getSet()))); | private StringSetResult getStringSetValue(MetricUpdate metricUpdate) {
if (metricUpdate.getSet() == null) {
return StringSetResult.empty();
}
return StringSetResult.create(ImmutableSet.copyOf(((Set) metricUpdate.getSet())));
} | class DataflowMetricResultExtractor {
private final ImmutableList.Builder<MetricResult<Long>> counterResults;
private final ImmutableList.Builder<MetricResult<DistributionResult>> distributionResults;
private final ImmutableList.Builder<MetricResult<GaugeResult>> gaugeResults;
private final ImmutableLis... | class DataflowMetricResultExtractor {
private final ImmutableList.Builder<MetricResult<Long>> counterResults;
private final ImmutableList.Builder<MetricResult<DistributionResult>> distributionResults;
private final ImmutableList.Builder<MetricResult<GaugeResult>> gaugeResults;
private final ImmutableLis... |
remove unnecessary `String.format` here and at other locations | public void testUnsetCatalogWithSelectCurrentTimestamp() throws Exception {
TableEnvironment tEnv = TableEnvironment.create(ENVIRONMENT_SETTINGS);
tEnv.useCatalog(null);
Table table = tEnv.sqlQuery(String.format("SELECT CURRENT_TIMESTAMP;"));
assertThat(table.getResolvedSchema()).isEqu... | Table table = tEnv.sqlQuery(String.format("SELECT CURRENT_TIMESTAMP;")); | public void testUnsetCatalogWithSelectCurrentTimestamp() throws Exception {
TableEnvironment tEnv = TableEnvironment.create(ENVIRONMENT_SETTINGS);
tEnv.useCatalog(null);
Table table = tEnv.sqlQuery("SELECT CURRENT_TIMESTAMP");
assertThat(table.getResolvedSchema()).isEqualTo(CURRENT_TIM... | class UnknownCatalogTest {
public static final String BUILTIN_CATALOG = "cat";
private static final String BUILTIN_DATABASE = "db";
public static final EnvironmentSettings ENVIRONMENT_SETTINGS =
EnvironmentSettings.newInstance()
.inStreamingMode()
.withBu... | class UnknownCatalogTest {
public static final String BUILTIN_CATALOG = "cat";
private static final String BUILTIN_DATABASE = "db";
public static final EnvironmentSettings ENVIRONMENT_SETTINGS =
EnvironmentSettings.newInstance()
.inStreamingMode()
.withBu... |
```suggestion while ((next = lookahead.get()).token == JsonToken.START_ARRAY) { } ``` | private static boolean isArrayOfObjects(TokenBuffer buffer) {
if (buffer.current() != JsonToken.START_ARRAY) return false;
Supplier<Token> lookahead = buffer.lookahead();
Token next;
while ((next = lookahead.get()).token == JsonToken.START_ARRAY);
return next.token == JsonToken.S... | while ((next = lookahead.get()).token == JsonToken.START_ARRAY); | private static boolean isArrayOfObjects(TokenBuffer buffer) {
if (buffer.current() != JsonToken.START_ARRAY) return false;
Supplier<Token> lookahead = buffer.lookahead();
Token next;
while ((next = lookahead.get()).token == JsonToken.START_ARRAY) { }
return next.token == JsonToke... | class TensorReader {
public static final String TENSOR_TYPE = "type";
public static final String TENSOR_ADDRESS = "address";
public static final String TENSOR_CELLS = "cells";
public static final String TENSOR_VALUES = "values";
public static final String TENSOR_BLOCKS = "blocks";
public static... | class TensorReader {
public static final String TENSOR_TYPE = "type";
public static final String TENSOR_ADDRESS = "address";
public static final String TENSOR_CELLS = "cells";
public static final String TENSOR_VALUES = "values";
public static final String TENSOR_BLOCKS = "blocks";
public static... |
```suggestion try { return valueState.value(); } catch (Exception e) { throw new RuntimeException("Error while getting value from raw ValueState", e); } ``` | public V value() {
V value;
try {
value = valueState.value();
} catch (Exception e) {
throw new RuntimeException("Error while getting value from raw ValueState", e);
}
return value;
} | return value; | public V value() {
try {
return valueState.value();
} catch (Exception e) {
throw new RuntimeException("Error while getting value from raw ValueState", e);
}
} | class ValueStateWrapper<V> implements ValueState<V> {
private final org.apache.flink.api.common.state.ValueState<V> valueState;
public ValueStateWrapper(org.apache.flink.api.common.state.ValueState<V> valueState) {
this.valueState = valueState;
}
public StateFuture<V> asyncValue() {
tr... | class ValueStateWrapper<V> implements ValueState<V> {
private final org.apache.flink.api.common.state.ValueState<V> valueState;
public ValueStateWrapper(org.apache.flink.api.common.state.ValueState<V> valueState) {
this.valueState = valueState;
}
public StateFuture<V> asyncValue() {
tr... |
`checkArgument`? Your error message can also be simpler - `"%s is not a %s", application.getTransform(), ProcessElements.class.getSimpleName()` | public DoFnLifecycleManager load(final AppliedPTransform<?, ?, ?> application) {
if (!ProcessElements.class.isInstance(application.getTransform())) {
throw new IllegalArgumentException(
"No know extraction of the fn from " + application);
}
fin... | "No know extraction of the fn from " + application); | public DoFnLifecycleManager load(final AppliedPTransform<?, ?, ?> application) {
checkArgument(
ProcessElements.class.isInstance(application.getTransform()),
"No know extraction of the fn from " + application);
final ProcessElements<InputT, OutputT, Restrictio... | class SplittableProcessElementsEvaluatorFactory<
InputT, OutputT, RestrictionT, TrackerT extends RestrictionTracker<RestrictionT>>
implements TransformEvaluatorFactory {
private final ParDoEvaluatorFactory<KeyedWorkItem<String, KV<InputT, RestrictionT>>, OutputT>
delegateFactory;
private final Sch... | class SplittableProcessElementsEvaluatorFactory<
InputT,
OutputT,
RestrictionT,
PositionT,
TrackerT extends RestrictionTracker<RestrictionT, PositionT>>
implements TransformEvaluatorFactory {
private final ParDoEvaluatorFactory<KeyedWorkItem<String, KV<InputT, RestrictionT>... |
that's a good question, when we originally implemented connection strings, the Portal U/X only included IngestionEndpoint for gov clouds, so the default was important, but now the Portal U/X always includes IngestionEndpoint, so the default is likely not needed anymore. I'll start an internal thread and add you to see ... | public AzureMonitorExporterBuilder connectionString(String connectionString) {
this.instrumentationKey = extractValueFromConnectionString(connectionString, "InstrumentationKey");
this.endpoint(extractValueFromConnectionString(connectionString, "IngestionEndpoint"));
return this;
} | return this; | public AzureMonitorExporterBuilder connectionString(String connectionString) {
Map<String, String> keyValues = extractKeyValuesFromConnectionString(connectionString);
if (!keyValues.containsKey("InstrumentationKey")) {
throw logger.logExceptionAsError(
new IllegalArgumentExce... | class AzureMonitorExporterBuilder {
private final ClientLogger logger = new ClientLogger(AzureMonitorExporterBuilder.class);
private final ApplicationInsightsClientImplBuilder restServiceClientBuilder;
private String instrumentationKey;
/**
* Creates an instance of {@link AzureMonitorExporterBuild... | class AzureMonitorExporterBuilder {
private final ClientLogger logger = new ClientLogger(AzureMonitorExporterBuilder.class);
private final ApplicationInsightsClientImplBuilder restServiceClientBuilder;
private String instrumentationKey;
/**
* Creates an instance of {@link AzureMonitorExporterBuild... |
The error log will be printed outside | private void getNewImage(Pair<String, Integer> helperNode) throws IOException {
long localImageVersion = 0;
Storage storage = new Storage(this.imageDir);
localImageVersion = storage.getImageSeq();
try {
URL infoUrl = new URL("http:
StorageInfo info = getStorageIn... | throw new IOException(e); | private void getNewImage(Pair<String, Integer> helperNode) throws IOException {
long localImageVersion = 0;
Storage storage = new Storage(this.imageDir);
localImageVersion = storage.getImageSeq();
try {
URL infoUrl = new URL("http:
StorageInfo info = getStorageIn... | class SingletonHolder {
private static final Catalog INSTANCE = new Catalog();
} | class SingletonHolder {
private static final Catalog INSTANCE = new Catalog();
} |
Thanks for the review. Yeah that's the only bug that blocked this feature. | public void onMatch(RelOptRuleCall call) {
LogicalCorrelate correlate = call.rel(0);
RelNode outer = call.rel(1);
RelNode uncollect = call.rel(2);
if (correlate.getRequiredColumns().cardinality() != 1) {
return;
}
if (correlate.getJoinType() != JoinRelType.INNER) {
return;
... | if (correlate.getRequiredColumns().cardinality() != 1) { | public void onMatch(RelOptRuleCall call) {
LogicalCorrelate correlate = call.rel(0);
RelNode outer = call.rel(1);
RelNode uncollect = call.rel(2);
if (correlate.getRequiredColumns().cardinality() != 1) {
return;
}
if (correlate.getJoinType() != JoinRelType.INNER) {
return;
... | class BeamZetaSqlUnnestRule extends RelOptRule {
public static final BeamZetaSqlUnnestRule INSTANCE = new BeamZetaSqlUnnestRule();
private BeamZetaSqlUnnestRule() {
super(
operand(
LogicalCorrelate.class, operand(RelNode.class, any()), operand(SingleRel.class, any())),
"BeamZetaS... | class BeamZetaSqlUnnestRule extends RelOptRule {
public static final BeamZetaSqlUnnestRule INSTANCE = new BeamZetaSqlUnnestRule();
private BeamZetaSqlUnnestRule() {
super(
operand(
LogicalCorrelate.class, operand(RelNode.class, any()), operand(SingleRel.class, any())),
"BeamZetaS... |
no, it just helped me with understanding the paths when debugging test failures. But I can remove it | public void testExistingEmptyDirectoryRecursiveDeletion() throws IOException {
final Path path = new Path(basePath, "dir-" + randomName());
fs.mkdirs(path);
testSuccessfulDeletion(path, true);
} | final Path path = new Path(basePath, "dir-" + randomName()); | public void testExistingEmptyDirectoryRecursiveDeletion() throws IOException {
final Path path = new Path(basePath, randomName());
fs.mkdirs(path);
testSuccessfulDeletion(path, true);
} | class FileSystemBehaviorTestSuite {
private static final Random RND = new Random();
/** The cached file system instance. */
private FileSystem fs;
/** The cached base path. */
private Path basePath;
/** Gets an instance of the {@code FileSystem} to be tested. */
public ab... | class FileSystemBehaviorTestSuite {
private static final Random RND = new Random();
/** The cached file system instance. */
private FileSystem fs;
/** The cached base path. */
private Path basePath;
/** Gets an instance of the {@code FileSystem} to be tested. */
public ab... |
In old version, when execute ```replayBatchRemoveTransaction```, txnId could be removed when txnId locates in head of deque. So in V2, how to ensure the consistency between latestTxnIdForShort/latestTxnIdForLong and finalStatusTransactionStateDequeShort/finalStatusTransactionStateDequeLong. Is there the case that late... | public void replayBatchRemoveTransaction(BatchRemoveTransactionsOperationV2 operation) {
writeLock();
try {
int numOfClearedTransaction = 0;
if (operation.getLatestTxnIdForShort() != -1) {
while (!finalStatusTransactionStateDequeShort.isEmpty()) {
... | TransactionState transactionState = finalStatusTransactionStateDequeShort.pop(); | public void replayBatchRemoveTransaction(BatchRemoveTransactionsOperationV2 operation) {
writeLock();
try {
if (operation.getLatestTxnIdForShort() != -1) {
while (!finalStatusTransactionStateDequeShort.isEmpty()) {
TransactionState transactionState = final... | class DatabaseTransactionMgr {
private static final Logger LOG = LogManager.getLogger(DatabaseTransactionMgr.class);
private static final int MAX_REMOVE_TXN_PER_ROUND = 10000;
private final long dbId;
private final ReentrantReadWriteLock transactionLock = new ReentrantReadWriteLoc... | class DatabaseTransactionMgr {
private static final Logger LOG = LogManager.getLogger(DatabaseTransactionMgr.class);
private static final int MAX_REMOVE_TXN_PER_ROUND = 10000;
private final long dbId;
private final ReentrantReadWriteLock transactionLock = new ReentrantReadWriteLoc... |
Can you please elaborate on this logic , why we needed it first place, and how it will fix our caching issue moving from UUID to incremental counter | private String generateQueryParameter(@NonNull String subject, int counter) {
return subject.replaceAll("[^a-zA-Z\\d]", "_") + counter;
} | return subject.replaceAll("[^a-zA-Z\\d]", "_") + counter; | private String generateQueryParameter(@NonNull String subject, int counter) {
return subject.replaceAll("[^a-zA-Z\\d]", "_") + counter;
} | class AbstractQueryGenerator {
protected AbstractQueryGenerator() {
}
private String generateUnaryQuery(@NonNull Criteria criteria) {
Assert.isTrue(criteria.getSubjectValues().isEmpty(), "Unary criteria should have no one subject value");
Assert.isTrue(CriteriaType.isUnary(criteria.g... | class AbstractQueryGenerator {
protected AbstractQueryGenerator() {
}
private String generateUnaryQuery(@NonNull Criteria criteria) {
Assert.isTrue(criteria.getSubjectValues().isEmpty(), "Unary criteria should have no one subject value");
Assert.isTrue(CriteriaType.isUnary(criteria.g... |
If it is null it returns nil. | public void execute(Context context) {
@SuppressWarnings(ArtemisConstants.UNCHECKED)
BMap<String, BValue> messageObj = (BMap<String, BValue>) context.getRefArgument(0);
ClientMessage message = (ClientMessage) messageObj.getNativeData(ArtemisConstants.ARTEMIS_MESSAGE);
String key = conte... | if (property != null) { | public void execute(Context context) {
@SuppressWarnings(ArtemisConstants.UNCHECKED)
BMap<String, BValue> messageObj = (BMap<String, BValue>) context.getRefArgument(0);
ClientMessage message = (ClientMessage) messageObj.getNativeData(ArtemisConstants.ARTEMIS_MESSAGE);
String key = conte... | class GetProperty extends BlockingNativeCallableUnit {
@Override
} | class GetProperty extends BlockingNativeCallableUnit {
@Override
} |
please make sure args is in the same order. | public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
int type = columnDef.getColumnMeta() >> 8;
int length = columnDef.getColumnMeta() & 0xff;
if ((type & 0x30) != 0x30) {
length += ((type & 0x30) ^ 0x30) << 4;
type |... | return payload.readStringFix(readActualLength(payload, length)); | public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
int type = columnDef.getColumnMeta() >> 8;
int length = columnDef.getColumnMeta() & 0xff;
if ((type & 0x30) != 0x30) {
length += ((type & 0x30) ^ 0x30) << 4;
type |... | class MySQLStringBinlogProtocolValue implements MySQLBinlogProtocolValue {
@Override
private int readActualLength(final MySQLPacketPayload payload, final int length) {
if (length < 256) {
return payload.getByteBuf().readUnsignedByte();
}
return payload.getByteB... | class MySQLStringBinlogProtocolValue implements MySQLBinlogProtocolValue {
@Override
private int readActualLength(final int length, final MySQLPacketPayload payload) {
if (length < 256) {
return payload.getByteBuf().readUnsignedByte();
}
return payload.getByteB... |
I use that pattern in multiple places and had no issue as soon as... you do not touch the RESAssured shared config while running. | public void testWithConcurrentCalls() {
List<String> results = new CopyOnWriteArrayList<>();
int count = 100;
barrier.setMaxConcurrency(count);
for (int i = 0; i < count; i++) {
int c = i;
new Thread(() -> {
ResponseBody<?> body = RestAssured.given... | ResponseBody<?> body = RestAssured.given().pathParam("val", c).contentType(MediaType.APPLICATION_JSON) | public void testWithConcurrentCalls() {
List<String> results = new CopyOnWriteArrayList<>();
int count = 100;
barrier.setMaxConcurrency(count);
for (int i = 0; i < count; i++) {
int c = i;
new Thread(() -> {
ResponseBody<?> body = RestAssured.given... | class RequestLeakDetectionTest {
@RegisterExtension
static QuarkusUnitTest test = new QuarkusUnitTest()
.withApplicationRoot((jar) -> jar.addClasses(MyRestAPI.class, MyRequestScopeBean.class, Barrier.class, Task.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"));
... | class RequestLeakDetectionTest {
@RegisterExtension
static QuarkusUnitTest test = new QuarkusUnitTest()
.withApplicationRoot((jar) -> jar.addClasses(MyRestAPI.class, MyRequestScopeBean.class, Barrier.class, Task.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"));
... |
```suggestion ErrorReport.reportDdlException(ErrorCode.ERR_CANT_CREATE_TABLE, tableName, "create denied"); ``` | public Table createTable(LocalMetastore metastore, Database db, CreateTableStmt stmt) throws DdlException {
GlobalStateMgr stateMgr = metastore.getStateMgr();
EditLog editLog = metastore.getEditLog();
ColocateTableIndex colocateTableIndex = metastore.getColocateTableIndex();
String table... | ErrorReport.reportDdlException(ErrorCode.ERR_CANT_CREATE_TABLE, tableName, "access denied"); | public Table createTable(LocalMetastore metastore, Database db, CreateTableStmt stmt) throws DdlException {
GlobalStateMgr stateMgr = metastore.getStateMgr();
EditLog editLog = metastore.getEditLog();
ColocateTableIndex colocateTableIndex = metastore.getColocateTableIndex();
String table... | class OlapTableFactory implements AbstractTableFactory {
private static final Logger LOG = LogManager.getLogger(OlapTableFactory.class);
public static final OlapTableFactory INSTANCE = new OlapTableFactory();
private OlapTableFactory() {
}
@Override
@NotNull
private void processConst... | class OlapTableFactory implements AbstractTableFactory {
private static final Logger LOG = LogManager.getLogger(OlapTableFactory.class);
public static final OlapTableFactory INSTANCE = new OlapTableFactory();
private OlapTableFactory() {
}
@Override
@NotNull
private void processConst... |
`SyntaxKind.PARENTHESIZED_ARG_LIST` does this handle a specific scenario? If yes, can we add a test case for that? | public List<SyntaxKind> getSyntaxKinds() {
return List.of(SyntaxKind.BOOLEAN_LITERAL, SyntaxKind.NUMERIC_LITERAL, SyntaxKind.STRING_LITERAL,
SyntaxKind.BINARY_EXPRESSION, SyntaxKind.START_ACTION, SyntaxKind.BRACED_EXPRESSION,
SyntaxKind.FUNCTION_CALL, SyntaxKind.QUALIFIED_NAME_RE... | SyntaxKind.PARENTHESIZED_ARG_LIST, SyntaxKind.ERROR_CONSTRUCTOR, SyntaxKind.OBJECT_CONSTRUCTOR); | public List<SyntaxKind> getSyntaxKinds() {
return List.of(SyntaxKind.BOOLEAN_LITERAL, SyntaxKind.NUMERIC_LITERAL, SyntaxKind.STRING_LITERAL,
SyntaxKind.BINARY_EXPRESSION, SyntaxKind.BRACED_EXPRESSION, SyntaxKind.XML_TEMPLATE_EXPRESSION,
SyntaxKind.FUNCTION_CALL, SyntaxKind.QUALIF... | class ExtractToLocalVarCodeAction implements RangeBasedCodeActionProvider {
public static final String NAME = "Extract To Local Variable";
private static final String VARIABLE_NAME_PREFIX = "var";
@Override
public boolean validate(CodeActionContext context, RangeBasedPositionDetails positionDeta... | class ExtractToLocalVarCodeAction implements RangeBasedCodeActionProvider {
public static final String NAME = "Extract To Local Variable";
private static final String VARIABLE_NAME_PREFIX = "var";
@Override
public boolean validate(CodeActionContext context, RangeBasedPositionDetails positionDeta... |
I think it is better to use a local variable other than changing the member variable. | public void analyze(Analyzer analyzer) throws AnalysisException, UserException {
dbTableName.analyze(analyzer);
if (!Catalog.getCurrentCatalog().getAuth().checkTblPriv(ConnectContext.get(), dbTableName.getDb(),
dbTableName.getTbl(), PrivPredicate.SHOW)) {
ErrorReport.reportA... | isAllTables = false; | public void analyze(Analyzer analyzer) throws AnalysisException, UserException {
dbTableName.analyze(analyzer);
if (!Catalog.getCurrentCatalog().getAuth().checkTblPriv(ConnectContext.get(), dbTableName.getDb(),
dbTableName.getTbl(), PrivPredicate.SHOW)) {
ErrorReport.reportA... | class DescribeStmt extends ShowStmt {
private static final ShowResultSetMetaData DESC_OLAP_TABLE_META_DATA =
ShowResultSetMetaData.builder()
.addColumn(new Column("Field", ScalarType.createVarchar(20)))
.addColumn(new Column("Type", ScalarType.createVarchar(20)))... | class DescribeStmt extends ShowStmt {
private static final ShowResultSetMetaData DESC_OLAP_TABLE_META_DATA =
ShowResultSetMetaData.builder()
.addColumn(new Column("Field", ScalarType.createVarchar(20)))
.addColumn(new Column("Type", ScalarType.createVarchar(20)))... |
The type is still `[int...]` right? The shape is `[int, int]`. Updates that change the shape can be done as long as they don't violate the inherent type (given the value is not immutable). IMO, `[int...]` is the same as `int[]`. | private void checkFixedLength(long length) {
if (arrayType != null && arrayType.getTag() == TypeTags.TUPLE_TAG) {
throw BLangExceptionHelper.getRuntimeException(BallerinaErrorReasons.INHERENT_TYPE_VIOLATION_ERROR,
RuntimeErrors.CANNOT_CHANGE_TUPLE_SIZE);
}
if (((B... | if (arrayType != null && arrayType.getTag() == TypeTags.TUPLE_TAG) { | private void checkFixedLength(long length) {
if (arrayType != null && arrayType.getTag() == TypeTags.TUPLE_TAG) {
throw BLangExceptionHelper.getRuntimeException(BallerinaErrorReasons.INHERENT_TYPE_VIOLATION_ERROR,
RuntimeErrors.CANNOT_CHANGE_TUPLE_SIZE);
}
if (((B... | class ArrayValue implements RefValue, CollectionValue {
static final int SYSTEM_ARRAY_MAX = Integer.MAX_VALUE - 8;
protected BType arrayType;
private volatile Status freezeStatus = new Status(State.UNFROZEN);
/**
* The maximum size of arrays to allocate.
* <p>
* This is same as Java
... | class ArrayValue implements RefValue, CollectionValue {
static final int SYSTEM_ARRAY_MAX = Integer.MAX_VALUE - 8;
protected BType arrayType;
private volatile Status freezeStatus = new Status(State.UNFROZEN);
/**
* The maximum size of arrays to allocate.
* <p>
* This is same as Java
... |
We might need to be more strict here, but in the sample tests I performed, this seemed to work just fine | public boolean canConvert(Class type) {
return List.class.isAssignableFrom(type);
} | return List.class.isAssignableFrom(type); | public boolean canConvert(Class type) {
return (type != null) && SUPPORTED_CLASS_NAMES.contains(type.getName());
} | class CustomListConverter extends CollectionConverter {
public CustomListConverter(Mapper mapper) {
super(mapper);
}
@Override
@Override
protected Object createCollection(Class type) {
return new ArrayList<>();
}
} | class CustomListConverter extends CollectionConverter {
private final Set<String> SUPPORTED_CLASS_NAMES = Set.of(
List.of().getClass().getName(),
List.of(Integer.MAX_VALUE).getClass().getName(),
Arrays.asList(Integer.MAX_VALUE).getClass().getName(),
Collect... |
Let's stick with the `Deadline` as in your proposal there is already a small bug (for the timeout based on subtraction to work, you would have to subtract it only if `segment == null`, otherwise even if get the buffer after only a 1 millisecond of waiting, you subtract 2 seconds of waiting time). | public List<MemorySegment> requestMemorySegments() throws IOException {
synchronized (factoryLock) {
if (isDestroyed) {
throw new IllegalStateException("Network buffer pool has already been destroyed.");
}
if (numTotalRequiredBuffers + numberOfSegmentsToRequest > totalNumberOfMemorySegments) {
throw... | final Deadline deadline = Deadline.now().plus(Duration.ofMillis(requestSegmentsTimeoutInMillis)); | public List<MemorySegment> requestMemorySegments() throws IOException {
synchronized (factoryLock) {
if (isDestroyed) {
throw new IllegalStateException("Network buffer pool has already been destroyed.");
}
tryRedistributeBuffers();
}
final List<MemorySegment> segments = new ArrayList<>(numberOfSegm... | class NetworkBufferPool implements BufferPoolFactory, MemorySegmentProvider {
private static final Logger LOG = LoggerFactory.getLogger(NetworkBufferPool.class);
private final int totalNumberOfMemorySegments;
private final int memorySegmentSize;
private final ArrayBlockingQueue<MemorySegment> availableMemorySeg... | class NetworkBufferPool implements BufferPoolFactory, MemorySegmentProvider {
private static final Logger LOG = LoggerFactory.getLogger(NetworkBufferPool.class);
private final int totalNumberOfMemorySegments;
private final int memorySegmentSize;
private final ArrayBlockingQueue<MemorySegment> availableMemorySeg... |
should add en UT the unused_output_column_name isn't empty | public void testFilterComplexPredicate() throws Exception {
connectContext.getSessionVariable().enableTrimOnlyFilteredColumnsInScanStage();
String sql = "select\n" +
" ref_0.d_dow as c1 from tpcds_100g_date_dim as ref_0 \n" +
" where ref_0.d_day_name... | Assert.assertTrue(plan.contains("unused_output_column_name:[]")); | public void testFilterComplexPredicate() throws Exception {
connectContext.getSessionVariable().enableTrimOnlyFilteredColumnsInScanStage();
String sql = "select\n" +
" ref_0.d_dow as c1 from tpcds_100g_date_dim as ref_0 \n" +
" where ref_0.d_day_name... | class FilterUnusedColumnTest extends PlanTestBase {
@BeforeClass
public static void beforeClass() throws Exception {
PlanTestBase.beforeClass();
StarRocksAssert starRocksAssert = new StarRocksAssert(connectContext);
starRocksAssert.withTable("CREATE TABLE tpcds_100g_date_dim (d_dow INTEG... | class FilterUnusedColumnTest extends PlanTestBase {
@BeforeClass
public static void beforeClass() throws Exception {
PlanTestBase.beforeClass();
StarRocksAssert starRocksAssert = new StarRocksAssert(connectContext);
starRocksAssert.withTable("CREATE TABLE tpcds_100g_date_dim (d_dow INTEG... |
Well, it's the best way to avoid failing tests! | public void testUser() {
User user = new User("gsmet");
usersEntityManager.persist(user);
User savedUser = usersEntityManager.find(User.class, user.getId());
assertEquals(user.getName(), savedUser.getName());
OtherUserInSubPackage otherUserInSubPackage = new OtherUserInSubPacka... | assertEquals(otherUserInSubPackage.getName(), savedOtherUserInSubPackage.getName()); | public void testUser() {
User user = new User("gsmet");
usersEntityManager.persist(user);
User savedUser = usersEntityManager.find(User.class, user.getId());
assertEquals(user.getName(), savedUser.getName());
OtherUserInSubPackage otherUserInSubPackage = new OtherUserInSubPacka... | class MultiplePersistenceUnitsPackageAnnotationsTest {
@RegisterExtension
static QuarkusUnitTest runner = new QuarkusUnitTest()
.withApplicationRoot((jar) -> jar
.addPackage(Plane.class.getPackage().getName())
.addPackage(SharedEntity.class.getPackage().getNa... | class MultiplePersistenceUnitsPackageAnnotationsTest {
@RegisterExtension
static QuarkusUnitTest runner = new QuarkusUnitTest()
.withApplicationRoot((jar) -> jar
.addPackage(Plane.class.getPackage().getName())
.addPackage(SharedEntity.class.getPackage().getNa... |
There is no txnId if `begin transaction` failed, just log the label | private long loadTxnBeginImpl(TLoadTxnBeginRequest request, String clientIp) throws UserException {
checkPasswordAndLoadPriv(request.getUser(), request.getPasswd(), request.getDb(),
request.getTbl(), request.getUser_ip());
if (Strings.isNullOrEmpty(request.getLabel())) {
... | throw new UserException("Load begin transactonId failed"); | private long loadTxnBeginImpl(TLoadTxnBeginRequest request, String clientIp) throws UserException {
checkPasswordAndLoadPriv(request.getUser(), request.getPasswd(), request.getDb(),
request.getTbl(), request.getUser_ip());
if (Strings.isNullOrEmpty(request.getLabel())) {
... | class FrontendServiceImpl implements FrontendService.Iface {
private static final Logger LOG = LogManager.getLogger(LeaderImpl.class);
private final LeaderImpl leaderImpl;
private final ExecuteEnv exeEnv;
public FrontendServiceImpl(ExecuteEnv exeEnv) {
leaderImpl = new LeaderImpl();
thi... | class FrontendServiceImpl implements FrontendService.Iface {
private static final Logger LOG = LogManager.getLogger(LeaderImpl.class);
private final LeaderImpl leaderImpl;
private final ExecuteEnv exeEnv;
public FrontendServiceImpl(ExecuteEnv exeEnv) {
leaderImpl = new LeaderImpl();
thi... |
according to the [scheduler interface draft](https://docs.google.com/document/d/1fstkML72YBO1tGD_dmG2rwvd9bklhRVauh4FSsDDwXU/edit#), the `RestartBackoffTimeStrategy` is responsible for this decision. ```The delay is computed by a RestartBackoffTimeStrategy that is also responsible for deciding whether a restart should... | public FailureHandlingResult getFailureHandlingResult(ExecutionVertexID failedTask, Throwable cause) {
if (ThrowableClassifier.getThrowableType(cause) == ThrowableType.NonRecoverableError) {
return FailureHandlingResult.unrecoverable(new JobException("The failure is not recoverable", cause));
}
restartBackoff... | if (ThrowableClassifier.getThrowableType(cause) == ThrowableType.NonRecoverableError) { | public FailureHandlingResult getFailureHandlingResult(ExecutionVertexID failedTask, Throwable cause) {
if (isUnrecoverableError(cause)) {
return FailureHandlingResult.unrecoverable(new JobException("The failure is not recoverable", cause));
}
restartBackoffTimeStrategy.notifyFailure(cause);
if (restartBacko... | class ExecutionFailureHandler {
/** Strategy to judge which tasks should be restarted. */
private final FailoverStrategy failoverStrategy;
/** Strategy to judge whether and when a restarting should be done. */
private final RestartBackoffTimeStrategy restartBackoffTimeStrategy;
/**
* Creates the handler to de... | class ExecutionFailureHandler {
/** Strategy to judge which tasks should be restarted. */
private final FailoverStrategy failoverStrategy;
/** Strategy to judge whether and when a restarting should be done. */
private final RestartBackoffTimeStrategy restartBackoffTimeStrategy;
/**
* Creates the handler to de... |
Need to change toString method so the flag used is logged out. | static void initialize() {
ImplementationBridgeHelpers.CosmosClientTelemetryConfigHelper.setCosmosClientTelemetryConfigAccessor(
new ImplementationBridgeHelpers.CosmosClientTelemetryConfigHelper.CosmosClientTelemetryConfigAccessor() {
@Override
public Duration getHtt... | static void initialize() {
ImplementationBridgeHelpers.CosmosClientTelemetryConfigHelper.setCosmosClientTelemetryConfigAccessor(
new ImplementationBridgeHelpers.CosmosClientTelemetryConfigHelper.CosmosClientTelemetryConfigAccessor() {
@Override
public Duration getHtt... | class outside of this package. | class outside of this package. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.