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
Good catch. Yes, if an external table provider implements the interface, then it will get loaded here, I haven't thought about it. I can think of multiple ways to handle it. One is, as you suggested, to have a separate interface, another is to introduce something like a "@DoNotAutoLoad" annotation. I think it can be ad...
public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { return this; }
return this;
public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { return this; }
class LoadAllProviders extends InitialEmptySchema implements SchemaFactory { @Override public TableProvider toTableProvider(JdbcConnection connection) { MetaStore metaStore = new InMemoryMetaStore(); for (TableProvider provider : ServiceLoader.load(TableProvider.class, getClass().getClass...
class AllProviders extends InitialEmptySchema implements SchemaFactory { /** * We call this in {@link * by Calcite to a configured table provider. At this point we have a connection open and can * use it to configure Beam schemas, e.g. with pipeline options. * * <p><i>Note:</i> this loads...
Sorry I missed this but I think we need something better here. Because the exception is caught globally not only for the close() now and it could happen in the code that is in the try. So I would rather have an IllegalStateException with a proper message and the cause.
private List<String> getChangeLogs(LiquibaseMongodbBuildTimeConfig liquibaseBuildConfig) { ChangeLogParameters changeLogParameters = new ChangeLogParameters(); ChangeLogParserFactory changeLogParserFactory = ChangeLogParserFactory.getInstance(); try (var classLoaderResourceAccessor = new Class...
throw new AssertionError(ex);
private List<String> getChangeLogs(LiquibaseMongodbBuildTimeConfig liquibaseBuildConfig) { ChangeLogParameters changeLogParameters = new ChangeLogParameters(); ChangeLogParserFactory changeLogParserFactory = ChangeLogParserFactory.getInstance(); try (var classLoaderResourceAccessor = new Class...
class for reflection while also registering fields for reflection addService(services, reflective, liquibase.precondition.Precondition.class.getName(), true); addService(services, reflective, liquibase.command.CommandStep.class.getName(), false, "liquibase.command.core.StartH2C...
class for reflection while also registering fields for reflection addService(services, reflective, liquibase.precondition.Precondition.class.getName(), true); addService(services, reflective, liquibase.command.CommandStep.class.getName(), false, "liquibase.command.core.StartH2C...
https://github.com/reactor/reactor-core/blob/6058a391f614de6213fb85970272fc5b342bd181/reactor-core/src/main/java/reactor/util/concurrent/Queues.java#L88 Looks like that'd be 256 by default. Pretty high. We limit number of buffers. Shouldn't max concurrency == numBuffers ? Or maxConcurrency be <= numbBuffers with numB...
public static ParallelTransferOptions populateAndApplyDefaults(ParallelTransferOptions other) { other = other == null ? new ParallelTransferOptions(null, null, null) : other; return new ParallelTransferOptions( other.getBlockSize() == null ? Integer.valueOf(BlobAsyncClient.BLOB_DEFAULT_UPLOA...
other.getMaxConcurrency() == null ? Integer.valueOf(Queues.SMALL_BUFFER_SIZE) : other.getMaxConcurrency());
public static ParallelTransferOptions populateAndApplyDefaults(ParallelTransferOptions other) { other = other == null ? new ParallelTransferOptions(null, null, null) : other; return new ParallelTransferOptions( other.getBlockSize() == null ? Integer.valueOf(BlobAsyncClient.BLOB_DEFAULT_UPLOA...
class ModelHelper { /** * Determines whether or not the passed authority is IP style, that is, it is of the format {@code <host>:<port>}. * * @param authority The authority of a URL. * @throws MalformedURLException If the authority is malformed. * @return Whether the authority is IP style....
class ModelHelper { /** * Determines whether or not the passed authority is IP style, that is, it is of the format {@code <host>:<port>}. * * @param authority The authority of a URL. * @throws MalformedURLException If the authority is malformed. * @return Whether the authority is IP style....
Needed because ttl is milliseconds as integer, so it can't support time to live of more than 50 days. That's why we had to change it.
public static Message convertAmqpMessageToBrokeredMessage(org.apache.qpid.proton.message.Message amqpMessage, byte[] deliveryTag) { Message brokeredMessage; Section body = amqpMessage.getBody(); if (body != null) { if (body instanceof Data) { Binary messageData = ((Da...
ttlMillis = amqpMessage.getExpiryTime() - amqpMessage.getCreationTime();
public static Message convertAmqpMessageToBrokeredMessage(org.apache.qpid.proton.message.Message amqpMessage, byte[] deliveryTag) { Message brokeredMessage; Section body = amqpMessage.getBody(); if (body != null) { if (body instanceof Data) { Binary messageData = ((Da...
class MessageConverter { public static org.apache.qpid.proton.message.Message convertBrokeredMessageToAmqpMessage(Message brokeredMessage) { org.apache.qpid.proton.message.Message amqpMessage = Proton.message(); MessageBody body = brokeredMessage.getMessageBody(); if (body != null) { ...
class MessageConverter { public static org.apache.qpid.proton.message.Message convertBrokeredMessageToAmqpMessage(Message brokeredMessage) { org.apache.qpid.proton.message.Message amqpMessage = Proton.message(); MessageBody body = brokeredMessage.getMessageBody(); if (body != null) { ...
Int compare date shoule cast int, because int are 4byte, date is 16byte。 int is more chance to SIMD
public static boolean canCompareDate(PrimitiveType t1, PrimitiveType t2) { if (t1 == PrimitiveType.DATE) { if (t2 == PrimitiveType.DATE || t2.isStringType() || t2.isIntegerType()) { return true; } return false; } else if (t2 == PrimitiveType.DATE) { ...
if (t2 == PrimitiveType.DATE || t2.isStringType() || t2.isIntegerType()) {
public static boolean canCompareDate(PrimitiveType t1, PrimitiveType t2) { return (t1 == PrimitiveType.DATE && t2 == PrimitiveType.DATE); }
class Type { private static final Logger LOG = LogManager.getLogger(Type.class); public static int MAX_NESTING_DEPTH = 2; public static final ScalarType INVALID = new ScalarType(PrimitiveType.INVALID_TYPE); public static final ScalarType NULL = new ScalarType(PrimitiveType.NUL...
class Type { private static final Logger LOG = LogManager.getLogger(Type.class); public static int MAX_NESTING_DEPTH = 2; public static final ScalarType INVALID = new ScalarType(PrimitiveType.INVALID_TYPE); public static final ScalarType NULL = new ScalarType(PrimitiveType.NUL...
`config.getOptionalValue()` throws `IllegalArgumentException` if the property cannot be converted to the specified type. It was a bug in our integration - SM Config extension catches the exception as well: https://github.com/smallrye/smallrye-config/blob/master/implementation/src/main/java/io/smallrye/config/inject/Con...
public void validateConfigProperties(Map<String, Set<String>> properties) { Config config = ConfigProviderResolver.instance().getConfig(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { ConfigDeploymentTemplate.class.getClassLoader(); } ...
throw new DeploymentException(e);
public void validateConfigProperties(Map<String, Set<String>> properties) { Config config = ConfigProviderResolver.instance().getConfig(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { ConfigDeploymentTemplate.class.getClassLoader(); } ...
class ConfigDeploymentTemplate { private Class<?> load(String className, ClassLoader cl) { switch (className) { case "boolean": return boolean.class; case "byte": return byte.class; case "short": return short.class; ...
class ConfigDeploymentTemplate { private Class<?> load(String className, ClassLoader cl) { switch (className) { case "boolean": return boolean.class; case "byte": return byte.class; case "short": return short.class; ...
Public OpenAI service don't have an endpoint. If use provides `endpoint`, we assume they are targeting the Azure OpenAI service. Else, targeting OpenAI service.
private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; ClientOp...
if (endpoint != null) {
private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; ClientOp...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Genera...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Genera...
updated to do exact match first, then relaxed match
public static String defaultApiVersion(String id, Provider provider) { if (id == null || provider == null) { return null; } ResourceId resourceId = ResourceId.fromString(id); String resourceTypeWithoutNamespace = getFullResourceTypeWithoutNamespace(resourceId); String...
if (prt.resourceType().equalsIgnoreCase(resourceTypeWithoutNamespace)
public static String defaultApiVersion(String id, Provider provider) { if (id == null || provider == null) { return null; } ResourceId resourceId = ResourceId.fromString(id); String resourceTypeWithoutNamespace = getFullResourceTypeWithoutNamespace(resourceId); for (P...
class ResourceUtils { private ResourceUtils() { } /** * Extract resource group from a resource ID string. * * @param id the resource ID string * @return the resource group name */ public static String groupFromResourceId(String id) { return (id != null) ? ResourceId.fro...
class ResourceUtils { private ResourceUtils() { } /** * Extract resource group from a resource ID string. * * @param id the resource ID string * @return the resource group name */ public static String groupFromResourceId(String id) { return (id != null) ? ResourceId.fro...
The callbacks of `with(...)` might be called just right after the subscription if data is already there or if the workload it triggers is synchronous (e.g. you compute some value in-memory and there's no async I/O call involved).
public Handler<RoutingContext> clearCacheHandler() { return new DevConsolePostHandler() { @Override protected void handlePost(RoutingContext event, MultiMap form) { String cacheName = form.get("name"); Optional<Cache> cache = CaffeineCacheSupplier.cacheMa...
endResponse(event, NOT_FOUND, createResponseError(cacheName, errorMessage));
public Handler<RoutingContext> clearCacheHandler() { return new DevConsolePostHandler() { @Override protected void handlePost(RoutingContext event, MultiMap form) { String cacheName = form.get("name"); Optional<Cache> cache = CaffeineCacheSupplier.cacheMa...
class CacheDevConsoleRecorder { }
class CacheDevConsoleRecorder { }
can you add the expected formats in the error message? so that users will receive actionable errors
public static TableReference parseTableSpec(String tableSpec) { Matcher match = BigQueryIO.TABLE_SPEC.matcher(tableSpec); if (!match.matches()) { throw new IllegalArgumentException( "Table reference is not in the expected " + "format: " + tableSpec); } TableReference ref = new TableRefe...
"Table reference is not in the expected " + "format: " + tableSpec);
public static TableReference parseTableSpec(String tableSpec) { Matcher match = BigQueryIO.TABLE_SPEC.matcher(tableSpec); if (!match.matches()) { throw new IllegalArgumentException( String.format( "Table specification [%s] is not in one of the expected formats (" ...
class RetryJobId { private final String jobIdPrefix; private final int retryIndex; RetryJobId(String jobIdPrefix, int retryIndex) { this.jobIdPrefix = jobIdPrefix; this.retryIndex = retryIndex; } String getJobIdPrefix() { return jobIdPrefix; } int getRetryIndex() { ...
class RetryJobId { private final String jobIdPrefix; private final int retryIndex; RetryJobId(String jobIdPrefix, int retryIndex) { this.jobIdPrefix = jobIdPrefix; this.retryIndex = retryIndex; } String getJobIdPrefix() { return jobIdPrefix; } int getRetryIndex() { ...
@michalvavrik How does it look now ? I've added NPE check for `next` and ISE catch block for `remove`
private void removeInvalidEntries() { long now = now(); for (Iterator<Map.Entry<String, CacheEntry<T>>> it = cacheMap.entrySet().iterator(); it.hasNext();) { Map.Entry<String, CacheEntry<T>> next = it.next(); if (isEntryExpired(next.getValue(), now)) { it.remove()...
long now = now();
private void removeInvalidEntries() { long now = now(); for (Iterator<Map.Entry<String, CacheEntry<T>>> it = cacheMap.entrySet().iterator(); it.hasNext();) { Map.Entry<String, CacheEntry<T>> next = it.next(); if (next != null) { if (isEntryExpired(next.getValue(),...
class MemoryCache<T> { private volatile Long timerId = null; private Map<String, CacheEntry<T>> cacheMap = new ConcurrentHashMap<>();; private AtomicInteger size = new AtomicInteger(); private final Duration cacheTimeToLive; private final int cacheSize; public MemoryCache(Vertx vertx, Optional...
class MemoryCache<T> { private volatile Long timerId = null; private final Map<String, CacheEntry<T>> cacheMap = new ConcurrentHashMap<>(); private AtomicInteger size = new AtomicInteger(); private final Duration cacheTimeToLive; private final int cacheSize; public MemoryCache(Vertx vertx, Opt...
Suggest to use `getCatalogOrException()`. But should consider that if this is a replay thread, should ignore this exception if catalog does not exist. Same suggest for other exception logic in this method.
private void setExternalTableAutoAnalyze(Map<String, String> properties, ModifyTablePropertyOperationLog info) { if (properties.size() != 1) { LOG.warn("External table property should contain exactly 1 entry."); } if (!properties.containsKey(PropertyAnalyzer.PROPERTIES_AUTO_ANALYZE_P...
CatalogIf catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(info.getCtlName());
private void setExternalTableAutoAnalyze(Map<String, String> properties, ModifyTablePropertyOperationLog info) { if (properties.size() != 1) { LOG.warn("External table property should contain exactly 1 entry."); return; } if (!properties.containsKey(PropertyAnalyzer.PROPE...
class SingletonHolder { private static final Env INSTANCE = EnvFactory.getInstance().createEnv(false); }
class SingletonHolder { private static final Env INSTANCE = EnvFactory.getInstance().createEnv(false); }
I think only HiveTableSource performs parallelism inference. But this test won't use HiveTableSource, right?
public void init() throws IOException { hiveCatalog = HiveTestUtils.createHiveCatalog(); tEnv().registerCatalog(hiveCatalog.getName(), hiveCatalog); tEnv().useCatalog(hiveCatalog.getName()); tEnv().getConfig().getConfiguration().set( HiveOptions.TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM, false); super...
HiveOptions.TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM, false);
public void init() throws IOException { hiveCatalog = HiveTestUtils.createHiveCatalog(); tEnv().registerCatalog(hiveCatalog.getName(), hiveCatalog); tEnv().useCatalog(hiveCatalog.getName()); tEnv().getConfig().getConfiguration().set( HiveOptions.TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM, false); super...
class HiveSinkCompactionITCase extends CompactionITCaseBase { @Parameterized.Parameters(name = "format = {0}") public static Collection<String> parameters() { return Arrays.asList("sequencefile", "parquet"); } @Parameterized.Parameter public String format; private HiveCatalog hiveCatalog; @Override @Befor...
class HiveSinkCompactionITCase extends CompactionITCaseBase { @Parameterized.Parameters(name = "format = {0}") public static Collection<String> parameters() { return Arrays.asList("sequencefile", "parquet"); } @Parameterized.Parameter public String format; private HiveCatalog hiveCatalog; @Override @Befor...
Instead of a, b, c shall we say val1, val2 and val3 because that makes more sense. Or more meaningful like hexStringArray, base64StringArray and numArray.
public void testByteArrayReturn() { byte[] a = ByteArrayUtils.hexStringToByteArray("aaabcfccadafcd341a4bdfabcd8912df"); byte[] b = ByteArrayUtils.decodeBase64("aGVsbG8gYmFsbGVyaW5hICEhIQ=="); byte[] c = new byte[]{3, 4, 5, 6, 7, 8, 9}; BValue[] returns = BRunUtil.invoke(result, "testByte...
byte[] c = new byte[]{3, 4, 5, 6, 7, 8, 9};
public void testByteArrayReturn() { byte[] bytes1 = ByteArrayUtils.hexStringToByteArray("aaabcfccadafcd341a4bdfabcd8912df"); byte[] bytes2 = ByteArrayUtils.decodeBase64("aGVsbG8gYmFsbGVyaW5hICEhIQ=="); byte[] bytes3 = new byte[]{3, 4, 5, 6, 7, 8, 9}; BValue[] returns = BRunUtil.invoke(re...
class BByteArrayValueTest { private CompileResult result; @BeforeClass public void setup() { result = BCompileUtil.compile("test-src/types/byte/byte-array-value.bal"); } @Test(description = "Test blob value assignment") public void testBlobParameter() { byte[] bytes = "string"...
class BByteArrayValueTest { private CompileResult result; @BeforeClass public void setup() { result = BCompileUtil.compile("test-src/types/byte/byte-array-value.bal"); } @Test(description = "Test blob value assignment") public void testBlobParameter() { byte[] bytes = "string"...
I think `isDefaultActionUnavailable()` is not the best choice here because suspension is a temporary state; some input may come after this check. What about using `mailboxProcessor.isMailboxLoopRunning()` instead? It is updated on `InputStatus.END_OF_INPUT` which seems exactly what is needed here.
public void waitForInputProcessing() throws Exception { while (taskThread.isAlive()) { boolean allEmpty = true; for (int i = 0; i < numInputGates; i++) { if (!inputGates[i].allQueuesEmpty()) { allEmpty = false; } } if (allEmpty) { break; } } final AtomicBoolean allInputProcess...
allInputProcessed.set(mailboxProcessor.isDefaultActionUnavailable());
public void waitForInputProcessing() throws Exception { while (taskThread.isAlive()) { boolean allEmpty = true; for (int i = 0; i < numInputGates; i++) { if (!inputGates[i].allQueuesEmpty()) { allEmpty = false; } } if (allEmpty) { break; } } final AtomicBoolean allInputProcess...
class StreamTaskTestHarness<OUT> { public static final int DEFAULT_MEMORY_MANAGER_SIZE = 1024 * 1024; public static final int DEFAULT_NETWORK_BUFFER_SIZE = 1024; private final FunctionWithException<Environment, ? extends StreamTask<OUT, ?>, Exception> taskFactory; public long memorySize; public int bufferSize;...
class StreamTaskTestHarness<OUT> { public static final int DEFAULT_MEMORY_MANAGER_SIZE = 1024 * 1024; public static final int DEFAULT_NETWORK_BUFFER_SIZE = 1024; private final FunctionWithException<Environment, ? extends StreamTask<OUT, ?>, Exception> taskFactory; public long memorySize; public int bufferSize;...
Ok, I add unit test now
public List<Record> fetchRecords(final int batchSize, final int timeout, final TimeUnit timeUnit) { List<Record> result = new LinkedList<>(); long start = System.currentTimeMillis(); int recordsCount = 0; while (batchSize > recordsCount) { List<Record> records = queue.poll();...
TimeUnit.MILLISECONDS.sleep(100L);
public List<Record> fetchRecords(final int batchSize, final int timeout, final TimeUnit timeUnit) { List<Record> result = new LinkedList<>(); long start = System.currentTimeMillis(); int recordsCount = 0; while (batchSize > recordsCount) { List<Record> records = queue.poll();...
class SimpleMemoryPipelineChannel implements PipelineChannel { private final BlockingQueue<List<Record>> queue; private final AckCallback ackCallback; public SimpleMemoryPipelineChannel(final int blockQueueSize, final AckCallback ackCallback) { this.queue = new ArrayBlockingQueue<>(bl...
class SimpleMemoryPipelineChannel implements PipelineChannel { private final BlockingQueue<List<Record>> queue; private final AckCallback ackCallback; public SimpleMemoryPipelineChannel(final int blockQueueSize, final AckCallback ackCallback) { this.queue = new ArrayBlockingQueue<>(bl...
Empty list means the solution needs no moves. null means there are no solutions. I don't understand the second paragraph - if it's null we continue because we found no solution. Otherwise we compare it to the current best, if any.
private Move findMitigatingMove(CapacityChecker.HostFailurePath failurePath) { Optional<Node> nodeWhichCantMove = failurePath.failureReason.tenant; if (nodeWhichCantMove.isEmpty()) return Move.empty(); Node node = nodeWhichCantMove.get(); NodeList allNodes = nodeRepository().list(); ...
if (shortestMitigation == null || shortestMitigation.size() > mitigation.size())
private Move findMitigatingMove(CapacityChecker.HostFailurePath failurePath) { Optional<Node> nodeWhichCantMove = failurePath.failureReason.tenant; if (nodeWhichCantMove.isEmpty()) return Move.empty(); Node node = nodeWhichCantMove.get(); NodeList allNodes = nodeRepository().list(); ...
class SpareCapacityMaintainer extends NodeRepositoryMaintainer { private final int maxIterations; private final Deployer deployer; private final Metric metric; public SpareCapacityMaintainer(Deployer deployer, NodeRepository nodeRepository, ...
class SpareCapacityMaintainer extends NodeRepositoryMaintainer { private final int maxIterations; private final Deployer deployer; private final Metric metric; public SpareCapacityMaintainer(Deployer deployer, NodeRepository nodeRepository, ...
I think rollup job can be changed to same as schema change job.
public void processAlterTable(AlterTableStmt stmt) throws UserException { TableName dbTableName = stmt.getTbl(); String dbName = dbTableName.getDb(); final String clusterName = stmt.getClusterName(); Database db = Catalog.getInstance().getDb(dbName); if (db == null) { ...
if (needTableStable && !hasSchemaChange) {
public void processAlterTable(AlterTableStmt stmt) throws UserException { TableName dbTableName = stmt.getTbl(); String dbName = dbTableName.getDb(); final String clusterName = stmt.getClusterName(); Database db = Catalog.getInstance().getDb(dbName); if (db == null) { ...
class Alter { private static final Logger LOG = LogManager.getLogger(Alter.class); private AlterHandler schemaChangeHandler; private AlterHandler materializedViewHandler; private SystemHandler clusterHandler; public Alter() { schemaChangeHandler = new SchemaChangeHandler(); materia...
class Alter { private static final Logger LOG = LogManager.getLogger(Alter.class); private AlterHandler schemaChangeHandler; private AlterHandler materializedViewHandler; private SystemHandler clusterHandler; public Alter() { schemaChangeHandler = new SchemaChangeHandler(); materia...
5 is the default value, turns out we can go with lower than default, I'll change this
public int getPriority() { return 9; }
return 9;
public int getPriority() { return 4; }
class GrpcLoadBalancerProvider extends LoadBalancerProvider { private static final Logger log = Logger.getLogger(GrpcLoadBalancerProvider.class); @Override public boolean isAvailable() { return true; } @Override @Override public String getPolicyName() { return "stork"...
class GrpcLoadBalancerProvider extends LoadBalancerProvider { private static final Logger log = Logger.getLogger(GrpcLoadBalancerProvider.class); @Override public boolean isAvailable() { return true; } @Override @Override public String getPolicyName() { return Stork.S...
Using `StringWriter` because of https://github.com/codejive/java-properties/issues/23
public void writeToDisk() throws IOException { if (rootProjectPath != null) { Files.write(rootProjectPath.resolve(getSettingsGradlePath()), getModel().getRootSettingsContent().getBytes()); if (hasRootProjectFile(GRADLE_PROPERTIES_PATH)) { try (StringWriter sw = new String...
sw.toString());
public void writeToDisk() throws IOException { if (rootProjectPath != null) { Files.write(rootProjectPath.resolve(getSettingsGradlePath()), getModel().getRootSettingsContent().getBytes()); if (hasRootProjectFile(GRADLE_PROPERTIES_PATH)) { try (StringWriter sw = new String...
class AbstractGradleBuildFile extends BuildFile { private static final Pattern DEPENDENCIES_SECTION = Pattern.compile("^[\\t ]*dependencies\\s*\\{\\s*$", Pattern.MULTILINE); private static final String GRADLE_PROPERTIES_PATH = "gradle.properties"; private final Path rootProjectPath; private final At...
class AbstractGradleBuildFile extends BuildFile { private static final Pattern DEPENDENCIES_SECTION = Pattern.compile("^[\\t ]*dependencies\\s*\\{\\s*$", Pattern.MULTILINE); private static final String GRADLE_PROPERTIES_PATH = "gradle.properties"; private final Path rootProjectPath; private final At...
@c15yi ok, a jose4j instance for verifying a signature can be built manually for this case with some custom basic resolver delegating to your new method, but I can take care of it later
public Uni<VerificationKeyResolver> resolve(TokenCredential tokenCred) { JsonObject headers = OidcUtils.decodeJwtHeaders(tokenCred.getToken()); Key key = findKeyInTheCache(headers); if (key != null) { return Uni.createFrom().item(new SingleKeyVerificationKeyResolver(key)); } ...
public Uni<VerificationKeyResolver> resolve(TokenCredential tokenCred) { JsonObject headers = OidcUtils.decodeJwtHeaders(tokenCred.getToken()); Key key = findKeyInTheCache(headers); if (key != null) { return Uni.createFrom().item(new SingleKeyVerificationKeyResolver(key)); } ...
class DynamicVerificationKeyResolver { private static final Logger LOG = Logger.getLogger(DynamicVerificationKeyResolver.class); private static final Set<String> KEY_HEADERS = Set.of(HeaderParameterNames.KEY_ID, HeaderParameterNames.X509_CERTIFICATE_SHA256_THUMBPRINT, HeaderParameterName...
class DynamicVerificationKeyResolver { private static final Logger LOG = Logger.getLogger(DynamicVerificationKeyResolver.class); private static final Set<String> KEY_HEADERS = Set.of(HeaderParameterNames.KEY_ID, HeaderParameterNames.X509_CERTIFICATE_SHA256_THUMBPRINT, HeaderParameterName...
That was the other option I pondered. I decided to go with this one.
public QuarkusCommandOutcome execute() throws QuarkusCommandException { Matcher matcher = JAVA_VERSION_PATTERN .matcher(this.javaTarget != null ? this.javaTarget : System.getProperty("java.version", "")); if (matcher.matches() && Integer.parseInt(matcher.group(1)) < 11) { ...
invocation.setProperty(JAVA_TARGET, invocation.getBuildTool() == BuildTool.MAVEN ? "1.8" : "1_8");
public QuarkusCommandOutcome execute() throws QuarkusCommandException { Matcher matcher = JAVA_VERSION_PATTERN .matcher(this.javaTarget != null ? this.javaTarget : System.getProperty("java.version", "")); if (matcher.matches() && Integer.parseInt(matcher.group(1)) < 11) { ...
class name"); } setProperty(CLASS_NAME, className); return this; } /** * @deprecated in 1.3.0.CR */ @Deprecated public CreateProject extensions(Set<String> extensions) { if (isSpringStyle(extensions)) { invocation.setValue(IS_SPRING, true); ...
class name"); } setProperty(CLASS_NAME, className); return this; } /** * @deprecated in 1.3.0.CR */ @Deprecated public CreateProject extensions(Set<String> extensions) { if (isSpringStyle(extensions)) { invocation.setValue(IS_SPRING, true); ...
it is a replay code path, no need to print the detailed stack trace.
public void replayTo(long journalId) throws StarException { JournalCursor cursor = null; try { cursor = bdbjeJournal.read(replayedJournalId.get() + 1, journalId); replayJournal(cursor); } catch (InterruptedException | JournalInconsistentException e) { LOG.warn...
LOG.warn("got exception when replay star mgr journal", e);
public void replayTo(long journalId) throws StarException { JournalCursor cursor = null; try { cursor = bdbjeJournal.read(replayedJournalId.get() + 1, journalId); replayJournal(cursor); } catch (InterruptedException | JournalInconsistentException e) { LOG.warn...
class StarOSBDBJEJournalSystem implements JournalSystem { private static final String JOURNAL_PREFIX = "starmgr_"; private static final int REPLAY_INTERVAL_MS = 1; private static final Logger LOG = LogManager.getLogger(StarOSBDBJEJournalSystem.class); private BDBJEJournal bdbjeJournal; private Jou...
class StarOSBDBJEJournalSystem implements JournalSystem { private static final String JOURNAL_PREFIX = "starmgr_"; private static final int REPLAY_INTERVAL_MS = 1; private static final Logger LOG = LogManager.getLogger(StarOSBDBJEJournalSystem.class); private BDBJEJournal bdbjeJournal; private Jou...
We can have a local variable or a constant for the sending text instead of repeating it
public void testMetrics() throws Exception { WebSocketTestClient client = new WebSocketTestClient("ws: client.handshake(); client.sendText("ds"); client.sendText("ds"); client.sendText("ds"); client.sendText("ds"); client.sendText("ds"); client.sendPing(SE...
client.sendText("ds");
public void testMetrics() throws Exception { WebSocketTestClient client = new WebSocketTestClient("ws: client.handshake(); client.sendText(MESSAGE); client.sendText(MESSAGE); client.sendText(MESSAGE); client.sendText(MESSAGE); client.sendText(MESSAGE); cli...
class WebSocketMetricsTestCase extends BaseTest { private static BServerInstance serverInstance; private static final Logger logger = LoggerFactory.getLogger(WebSocketMetricsTestCase.class); private static final String RESOURCE_LOCATION = "src" + File.separator + "test" + File.separator + "res...
class WebSocketMetricsTestCase extends BaseTest { private static BServerInstance serverInstance; private static final Logger logger = LoggerFactory.getLogger(WebSocketMetricsTestCase.class); private static final String MESSAGE = "test message"; private static final String CLOSE_MESSAGE = "closeMe"; ...
Should we add a comment here? IINM, I had the same suggestion, right? May not be immediately obvious.
private static boolean shouldWidenExpressionTypeWithNil(BLangAssignment assignNode) { if (!assignNode.expr.getBType().isNullable() || !isAssignmentToOptionalField(assignNode)) { return false; } BLangFieldBasedAccess fieldAccessNode = (BLangFieldBasedAccess) assignNode.varRef...
return false;
private static boolean shouldWidenExpressionTypeWithNil(BLangAssignment assignNode) { if (!assignNode.expr.getBType().isNullable() || !isAssignmentToOptionalField(assignNode)) { return false; } BLangFieldBasedAccess fieldAccessNode = (BLangFieldBasedAccess) assignNode.varRef...
class definition node for which the initializer is created * @param env The env for the type node * @return The generated initializer method */ private BLangFunction createGeneratedInitializerFunction(BLangClassDefinition classDefinition, SymbolEnv env) { BLangFunction generatedIni...
class definition node for which the initializer is created * @param env The env for the type node * @return The generated initializer method */ private BLangFunction createGeneratedInitializerFunction(BLangClassDefinition classDefinition, SymbolEnv env) { BLangFunction generatedIni...
Don't you want to sample the value with the windowing information attached? The runner would be responsible for pulling out the attributes that are being sampled that can be introspected and/or saved.
public void accept(WindowedValue<T> input) throws Exception { this.elementCountCounter.inc(input.getWindows().size()); this.sampledByteSizeDistribution.tryUpdate(input.getValue(), coder); if (outputSampler != null) { outputSampler.sample(input.getValue()); } ...
outputSampler.sample(input.getValue());
public void accept(WindowedValue<T> input) throws Exception { this.elementCountCounter.inc(input.getWindows().size()); this.sampledByteSizeDistribution.tryUpdate(input.getValue(), this.coder); if (outputSampler != null) { outputSampler.sample(input.getValue()); } ...
class MetricTrackingFnDataReceiver<T> implements FnDataReceiver<WindowedValue<T>> { private final FnDataReceiver<WindowedValue<T>> delegate; private final ExecutionState executionState; private final BundleCounter elementCountCounter; private final SampleByteSizeDistribution<T> sampledByteSizeDistributi...
class MetricTrackingFnDataReceiver<T> implements FnDataReceiver<WindowedValue<T>> { private final FnDataReceiver<WindowedValue<T>> delegate; private final ExecutionState executionState; private final BundleCounter elementCountCounter; private final SampleByteSizeDistribution<T> sampledByteSizeDistributi...
Also lose the ":\n". Those are not for you to add :-)
protected void maintain() { for (Application application : controller().applications().asList()) { for (Deployment deployment : application.deployments().values()) { try { MetricsService.DeploymentMetrics metrics = controller().metricsService() ...
log.log(Level.WARNING, "Timed out talking to YAMAS; retrying in " + maintenanceInterval() + ":\n", e);
protected void maintain() { for (Application application : controller().applications().asList()) { for (Deployment deployment : application.deployments().values()) { try { MetricsService.DeploymentMetrics metrics = controller().metricsService() ...
class DeploymentMetricsMaintainer extends Maintainer { private static final Logger log = Logger.getLogger(DeploymentMetricsMaintainer.class.getName()); DeploymentMetricsMaintainer(Controller controller, Duration duration, JobControl jobControl) { super(controller, duration, jobControl); } @Ov...
class DeploymentMetricsMaintainer extends Maintainer { private static final Logger log = Logger.getLogger(DeploymentMetricsMaintainer.class.getName()); DeploymentMetricsMaintainer(Controller controller, Duration duration, JobControl jobControl) { super(controller, duration, jobControl); } @Ov...
Thanks for your reminder. But I also compile `flink-sql-connector-hive-connector-3.1.2`, and the same exception throw. Then, I decompile and check the class file `org.apache.hadoop.hive.ql.metadata.VirtualColumn` in the `flink-sql-connector-hive-connector-3.1.2.jar`. I found the the line `public static final org.apach...
private static void checkColumnName(String columnName) throws SemanticException { ColumnInfo columnInfo = new ColumnInfo(); columnInfo.setAlias(columnName); if (VirtualColumn.isVirtualColumnBasedOnAlias(columnInfo)) { throw new SemanticException("Invalid column name " + columnName); ...
ColumnInfo columnInfo = new ColumnInfo();
private static void checkColumnName(String columnName) throws SemanticException { ColumnInfo columnInfo = new ColumnInfo(); columnInfo.setAlias(columnName); if (VirtualColumn.isVirtualColumnBasedOnAlias(columnInfo)) { throw new SemanticException("Invalid column name " + columnName); ...
class HiveParserBaseSemanticAnalyzer { private static final Logger LOG = LoggerFactory.getLogger(HiveParserBaseSemanticAnalyzer.class); private HiveParserBaseSemanticAnalyzer() {} public static List<FieldSchema> getColumns(HiveParserASTNode ast) throws SemanticException { return getColumns(ast, t...
class HiveParserBaseSemanticAnalyzer { private static final Logger LOG = LoggerFactory.getLogger(HiveParserBaseSemanticAnalyzer.class); private HiveParserBaseSemanticAnalyzer() {} public static List<FieldSchema> getColumns(HiveParserASTNode ast) throws SemanticException { return getColumns(ast, t...
Its not clear from this code, but the `HealthChecker` is shared, so cannot be closed here.
public void stop() { filebeatRestarter.shutdown(); if (!terminated.compareAndSet(false, true)) { throw new RuntimeException("Can not re-stop a node agent."); } signalWorkToBeDone(); do { try { loopThread.join(); filebeatRes...
healthChecker.ifPresent(HealthChecker::close);
public void stop() { filebeatRestarter.shutdown(); if (!terminated.compareAndSet(false, true)) { throw new RuntimeException("Can not re-stop a node agent."); } signalWorkToBeDone(); do { try { loopThread.join(); filebeatRes...
class NodeAgentImpl implements NodeAgent { private static final long BYTES_IN_GB = 1_000_000_000L; private static final Logger logger = Logger.getLogger(NodeAgentImpl.class.getName()); private final AtomicBoolean terminated = new AtomicBoolean(false); private boolean isFrozen = true; private ...
class NodeAgentImpl implements NodeAgent { private static final long BYTES_IN_GB = 1_000_000_000L; private static final Logger logger = Logger.getLogger(NodeAgentImpl.class.getName()); private final AtomicBoolean terminated = new AtomicBoolean(false); private boolean isFrozen = true; private ...
not particularly picky about this: but since we're now throwing on finding the decryption policy, could we just throw an exception in the for loop when we encounter it? That way we dont need to loop over all the rest of the policies if the first policy was a decryption policy?
private HttpPipeline getHttpPipeline() { if (httpPipeline != null) { List<HttpPipelinePolicy> policies = new ArrayList<>(); boolean decryptionPolicyPresent = false; for (int i = 0; i < httpPipeline.getPolicyCount(); i++) { HttpPipelinePol...
if (!decryptionPolicyPresent) {
private HttpPipeline getHttpPipeline() { if (httpPipeline != null) { List<HttpPipelinePolicy> policies = new ArrayList<>(); boolean decryptionPolicyPresent = false; for (int i = 0; i < httpPipeline.getPolicyCount(); i++) { HttpPipelinePol...
class EncryptedBlobClientBuilder { private final ClientLogger logger = new ClientLogger(EncryptedBlobClientBuilder.class); private static final String SDK_NAME = "name"; private static final String SDK_VERSION = "version"; private String endpoint; private String accountName; private String cont...
class EncryptedBlobClientBuilder { private final ClientLogger logger = new ClientLogger(EncryptedBlobClientBuilder.class); private static final String SDK_NAME = "name"; private static final String SDK_VERSION = "version"; private String endpoint; private String accountName; private String cont...
I think I got it now. Thanks
private Mono<Void> addIntendedCollectionRidAndSessionToken(RxDocumentServiceRequest request) { return applySessionToken(request).then(addIntendedCollectionRid(request)); }
return applySessionToken(request).then(addIntendedCollectionRid(request));
private Mono<Void> addIntendedCollectionRidAndSessionToken(RxDocumentServiceRequest request) { return applySessionToken(request).then(addIntendedCollectionRid(request)); }
class RxGatewayStoreModel implements RxStoreModel { private final static byte[] EMPTY_BYTE_ARRAY = {}; private final DiagnosticsClientContext clientContext; private final Logger logger = LoggerFactory.getLogger(RxGatewayStoreModel.class); private final Map<String, String> defaultHeaders; private fin...
class RxGatewayStoreModel implements RxStoreModel { private final static byte[] EMPTY_BYTE_ARRAY = {}; private final DiagnosticsClientContext clientContext; private final Logger logger = LoggerFactory.getLogger(RxGatewayStoreModel.class); private final Map<String, String> defaultHeaders; private fin...
Actually, it was the same. This method declare a dependency on the compile classpath which will make sure that gradle resolve all dependency even included build (which was not always guaranteed). This has no effect on the compile classpath of the task.
public FileCollection getClasspath() { return QuarkusGradleUtils.getSourceSet(getProject(), SourceSet.MAIN_SOURCE_SET_NAME).getCompileClasspath(); }
return QuarkusGradleUtils.getSourceSet(getProject(), SourceSet.MAIN_SOURCE_SET_NAME).getCompileClasspath();
public FileCollection getClasspath() { return QuarkusGradleUtils.getSourceSet(getProject(), SourceSet.MAIN_SOURCE_SET_NAME).getCompileClasspath(); }
class QuarkusGenerateCode extends QuarkusTask { public static final String QUARKUS_GENERATED_SOURCES = "quarkus-generated-sources"; public static final String QUARKUS_TEST_GENERATED_SOURCES = "quarkus-test-generated-sources"; public static final String[] CODE_GENERATION_PROVIDER = new String[] { "grpc...
class QuarkusGenerateCode extends QuarkusTask { public static final String QUARKUS_GENERATED_SOURCES = "quarkus-generated-sources"; public static final String QUARKUS_TEST_GENERATED_SOURCES = "quarkus-test-generated-sources"; public static final String[] CODE_GENERATION_PROVIDER = new String[] { "grpc...
why UniqueKey and PrimaryKey are different
public void testBitmapWithPrimaryKey() throws Exception { ColumnDef col3 = new ColumnDef("col3", new TypeDef(ScalarType.createType(PrimitiveType.BITMAP))); cols.add(col3); CreateTableStmt stmt = new CreateTableStmt(false, false, tblNameNoDb, cols, "olap", new KeysDesc(KeysType.PR...
expectedEx.expect(AnalysisException.class);
public void testBitmapWithPrimaryKey() throws Exception { ColumnDef col3 = new ColumnDef("col3", new TypeDef(ScalarType.createType(PrimitiveType.BITMAP))); cols.add(col3); CreateTableStmt stmt = new CreateTableStmt(false, false, tblNameNoDb, cols, "olap", new KeysDesc(KeysType.PR...
class CreateTableStmtTest { private static final Logger LOG = LoggerFactory.getLogger(CreateTableStmtTest.class); private TableName tblName; private TableName tblNameNoDb; private List<ColumnDef> cols; private List<ColumnDef> invalidCols; private List<String> colsName; private List<Str...
class CreateTableStmtTest { private static final Logger LOG = LoggerFactory.getLogger(CreateTableStmtTest.class); private TableName tblName; private TableName tblNameNoDb; private List<ColumnDef> cols; private List<ColumnDef> invalidCols; private List<String> colsName; private List<Str...
Ideal way is to keep a default configuration and return values from it.
public String getProperty(String key) { String result = null; if (key !=null) { if (this.properties.containsKey(key)) { result = this.properties.getString(key); } else { return key; } result = decodeTokenText(result); ...
return key;
public String getProperty(String key) { if (this.properties.containsKey(key)) { return this.properties.getString(key); } assert false; return this.defaultProperties.getString(key); }
class ParserConfigurations { private ResourceBundle properties = null; private static volatile ParserConfigurations instance = null; private static String language = "en"; private static String country = "LK"; private ParserConfigurations() { Locale currentLanguage; if (language ==...
class ParserConfigurations { private ResourceBundle properties; private ResourceBundle defaultProperties; private static volatile ParserConfigurations instance = null; private static String language = "en"; private static String country = "LK"; private ParserConfigurations() { Locale c...
The check is too strict then. We won't get `RUNNING` directly after starting the container. We need something like a repeated check which times out after some max startup time.
public RemoteEnvironment createEnvironment(Environment environment) throws Exception { Preconditions.checkState( environment .getUrn() .equals(BeamUrns.getUrn(RunnerApi.StandardEnvironments.Environments.DOCKER)), "The passed environment does not contain a DockerPayload."); ...
docker.isContainerRunning(containerId), "No container running for id " + containerId);
public RemoteEnvironment createEnvironment(Environment environment) throws Exception { Preconditions.checkState( environment .getUrn() .equals(BeamUrns.getUrn(RunnerApi.StandardEnvironments.Environments.DOCKER)), "The passed environment does not contain a DockerPayload."); ...
class DockerEnvironmentFactory implements EnvironmentFactory { private static final Logger LOG = LoggerFactory.getLogger(DockerEnvironmentFactory.class); static DockerEnvironmentFactory forServicesWithDocker( DockerCommand docker, GrpcFnServer<FnApiControlClientPoolService> controlServiceServer, ...
class DockerEnvironmentFactory implements EnvironmentFactory { private static final Logger LOG = LoggerFactory.getLogger(DockerEnvironmentFactory.class); static DockerEnvironmentFactory forServicesWithDocker( DockerCommand docker, GrpcFnServer<FnApiControlClientPoolService> controlServiceServer, ...
`s/Failed reload/Failed to reload/` or `s/Failed reload/Failed reload of/`
public void run() { try { reloadCryptoMaterial(TransportSecurityOptions.fromJsonFile(tlsOptionsConfigFile), trustManager, keyManager); } catch (Throwable t) { log.log(Level.SEVERE, String.format("Failed reload crypto material (path='%s'): %s", tlsOptionsConfigFile...
log.log(Level.SEVERE, String.format("Failed reload crypto material (path='%s'): %s", tlsOptionsConfigFile, t.getMessage()), t);
public void run() { try { reloadCryptoMaterial(TransportSecurityOptions.fromJsonFile(tlsOptionsConfigFile), trustManager, keyManager); } catch (Throwable t) { log.log(Level.SEVERE, String.format("Failed to reload crypto material (path='%s'): %s", tlsOptionsConfigF...
class CryptoMaterialReloader implements Runnable { @Override }
class CryptoMaterialReloader implements Runnable { @Override }
This no longer works, after parallell steps. It is also superseded by the validateSteps which is called after this method in the constructor.
private static List<Step> completeSteps(List<Step> steps) { if (steps.stream().anyMatch(step -> step.deploysTo(Environment.prod)) && steps.stream().noneMatch(step -> step.deploysTo(Environment.staging))) { steps.add(new DeclaredZone(Environment.staging)); } ...
steps.stream().noneMatch(step -> step.deploysTo(Environment.staging))) {
private static List<Step> completeSteps(List<Step> steps) { if (steps.stream().anyMatch(step -> step.deploysTo(Environment.prod)) && steps.stream().noneMatch(step -> step.deploysTo(Environment.staging))) { steps.add(new DeclaredZone(Environment.staging)); } ...
class DeploymentSpec { /** The empty deployment spec, specifying no zones or rotation, and defaults for all settings */ public static final DeploymentSpec empty = new DeploymentSpec(Optional.empty(), UpgradePolicy.defaultPolicy, ...
class DeploymentSpec { /** The empty deployment spec, specifying no zones or rotation, and defaults for all settings */ public static final DeploymentSpec empty = new DeploymentSpec(Optional.empty(), UpgradePolicy.defaultPolicy, ...
IMO, that copied code could be much simpler for Quarkus, but I rather copied it 1:1. Not sure what the general policy is here.
private static String getBuildInfo(String propertyId) { if (liquibaseBuildProperties == null) { try { liquibaseBuildProperties = new Properties(); final Enumeration<URL> propertiesUrls = Scope.getCurrentScope().getClassLoader() ...
private static String getBuildInfo(String propertyId) { if (liquibaseBuildProperties == null) { try { liquibaseBuildProperties = new Properties(); final Enumeration<URL> propertiesUrls = Scope.getCurrentScope().getClassLoader() ...
class SubstituteLiquibaseUtil { @Alias private static Properties liquibaseBuildProperties; @Substitute }
class SubstituteLiquibaseUtil { @Alias private static Properties liquibaseBuildProperties; @Substitute }
There is duplicate code here and above for creating the `AccessToken`, which is a possible source of bugs in the future if they are not kept in sync. Consider creating a method to centralise it.
public Mono<AccessToken> authenticateToIMDSEndpoint(TokenRequestContext request) { String resource = ScopeUtil.scopesToResource(request.getScopes()); StringBuilder payload = new StringBuilder(); final int imdsUpgradeTimeInMs = 70 * 1000; try { payload.append("api-version=");...
msiToken.getExpiresAt().plusMinutes(2).minus(options.getRefreshBeforeExpiry()));
public Mono<AccessToken> authenticateToIMDSEndpoint(TokenRequestContext request) { String resource = ScopeUtil.scopesToResource(request.getScopes()); StringBuilder payload = new StringBuilder(); final int imdsUpgradeTimeInMs = 70 * 1000; try { payload.append("api-version=");...
class IdentityClient { private static final SerializerAdapter SERIALIZER_ADAPTER = JacksonAdapter.createDefaultSerializerAdapter(); private static final Random RANDOM = new Random(); private final ClientLogger logger = new ClientLogger(IdentityClient.class); private final IdentityClientOptions options;...
class IdentityClient { private static final SerializerAdapter SERIALIZER_ADAPTER = JacksonAdapter.createDefaultSerializerAdapter(); private static final Random RANDOM = new Random(); private final ClientLogger logger = new ClientLogger(IdentityClient.class); private final IdentityClientOptions options;...
_Maybe_ INFO, why would there be a warning for something that is expected and not a problem?
void converge() { final Optional<ContainerNodeSpec> nodeSpecOptional = nodeRepository.getContainerNodeSpec(hostname); if (!nodeSpecOptional.isPresent() && expectNodeNotInNodeRepo) return; final ContainerNodeSpec nodeSpec = nodeSpecOptional.orElseThrow(() -> new Illegal...
if (!nodeSpecOptional.isPresent() && expectNodeNotInNodeRepo) return;
void converge() { final Optional<ContainerNodeSpec> nodeSpecOptional = nodeRepository.getContainerNodeSpec(hostname); if (!nodeSpecOptional.isPresent() && expectNodeNotInNodeRepo) return; final ContainerNodeSpec nodeSpec = nodeSpecOptional.orElseThrow(() -> new Illegal...
class NodeAgentImpl implements NodeAgent { private static final long BYTES_IN_GB = 1_000_000_000L; private final AtomicBoolean terminated = new AtomicBoolean(false); private boolean isFrozen = true; private boolean wantFrozen = false; private boolean workToDoNow = true; private boolean ex...
class NodeAgentImpl implements NodeAgent { private static final long BYTES_IN_GB = 1_000_000_000L; private final AtomicBoolean terminated = new AtomicBoolean(false); private boolean isFrozen = true; private boolean wantFrozen = false; private boolean workToDoNow = true; private boolean ex...
we can directly return instruction.pos
private Location getDesugaredPosition(BIRBasicBlock basicBlock) { Location desugaredPos = basicBlock.terminator.pos; for (BIRNonTerminator instruction : basicBlock.instructions) { if (instruction.pos != null) { desugaredPos = instruction.pos; ...
desugaredPos = instruction.pos;
private Location getDesugaredPosition(BIRBasicBlock basicBlock) { for (BIRNonTerminator instruction : basicBlock.instructions) { if (instruction.pos != null) { return instruction.pos; } } return basicBlock.terminator.pos; }
class JvmObservabilityGen { private static final String ENTRY_POINT_MAIN_METHOD_NAME = "main"; private static final String NEW_BB_PREFIX = "observabilityDesugaredBB"; private static final String INVOCATION_INSTRUMENTATION_TYPE = "invocation"; private static final String FUNC_BODY_INSTRUMENTATION_TYPE = ...
class JvmObservabilityGen { private static final String ENTRY_POINT_MAIN_METHOD_NAME = "main"; private static final String NEW_BB_PREFIX = "observabilityDesugaredBB"; private static final String INVOCATION_INSTRUMENTATION_TYPE = "invocation"; private static final String FUNC_BODY_INSTRUMENTATION_TYPE = ...
Yes it is. `connection.action()` returns BuildActionExecuter and if you check docs: for forTasks method: `Specifies the tasks to execute before executing the BuildAction.` https://docs.gradle.org/current/javadoc/org/gradle/tooling/BuildActionExecuter.html
public static QuarkusModel create(File projectDir, String mode, List<String> jvmArgs, String... tasks) { try (ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(projectDir) .connect()) { return connection.action(new QuarkusModelBuildAct...
return connection.action(new QuarkusModelBuildAction(mode)).forTasks(tasks).addJvmArguments(jvmArgs).run();
public static QuarkusModel create(File projectDir, String mode, List<String> jvmArgs, String... tasks) { try (ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(projectDir) .connect()) { return connection.action(new QuarkusModelBuildAct...
class QuarkusGradleModelFactory { public static QuarkusModel create(File projectDir, String mode, String... tasks) { return create(projectDir, mode, Collections.emptyList(), tasks); } public static QuarkusModel createForTasks(File projectDir, String... tasks) { try (ProjectConnection...
class QuarkusGradleModelFactory { public static QuarkusModel create(File projectDir, String mode, String... tasks) { return create(projectDir, mode, Collections.emptyList(), tasks); } public static QuarkusModel createForTasks(File projectDir, String... tasks) { try (ProjectConnection...
I was in doubt whether this exception type is appropriate here or whether an `Optional` should be returned. But at the upper level, it ultimately should be used, and the reason is only known here (so it would be harder to analyze the exception/empty buffers later).
private List<Buffer> getInflightBuffersUnsafe(long checkpointId) throws CheckpointException { assert Thread.holdsLock(receivedBuffers); if (checkpointId < lastBarrierId) { throw new CheckpointException( String.format("Sequence number for checkpoint %d is not known (it was likely been overwritten by a newer ...
throw new CheckpointException(
private List<Buffer> getInflightBuffersUnsafe(long checkpointId) throws CheckpointException { assert Thread.holdsLock(receivedBuffers); if (checkpointId < lastBarrierId) { throw new CheckpointException( String.format("Sequence number for checkpoint %d is not known (it was likely been overwritten by a newer ...
class RemoteInputChannel extends InputChannel { private static final int NONE = -1; /** ID to distinguish this channel from other channels sharing the same TCP connection. */ private final InputChannelID id = new InputChannelID(); /** The connection to use to request the remote partition. */ private final Conne...
class RemoteInputChannel extends InputChannel { private static final int NONE = -1; /** ID to distinguish this channel from other channels sharing the same TCP connection. */ private final InputChannelID id = new InputChannelID(); /** The connection to use to request the remote partition. */ private final Conne...
Also, it can't really break anything, can it? In my eyes, this is how `checkPermission` method should look like at the first place.
public Uni<Boolean> checkPermission(Permission permission) { return association.getDeferredIdentity() .flatMap(new Function<>() { @Override public Uni<? extends Boolean> apply(SecurityIdentity identity) { return identity.checkPermis...
return association.getDeferredIdentity()
public Uni<Boolean> checkPermission(Permission permission) { return association.getDeferredIdentity() .flatMap(new Function<>() { @Override public Uni<? extends Boolean> apply(SecurityIdentity identity) { return identity.checkPermis...
class SecurityIdentityProxy implements SecurityIdentity { @Inject SecurityIdentityAssociation association; @Override public Principal getPrincipal() { return association.getIdentity().getPrincipal(); } @Override public boolean isAnonymous() { return association.getIdentity...
class SecurityIdentityProxy implements SecurityIdentity { @Inject SecurityIdentityAssociation association; @Override public Principal getPrincipal() { return association.getIdentity().getPrincipal(); } @Override public boolean isAnonymous() { return association.getIdentity...
Should the get always return a new instance?
public SimpleVersionedSerializer<KafkaCommittable> getCommittableSerializer() { return new KafkaCommittableSerializer(); }
return new KafkaCommittableSerializer();
public SimpleVersionedSerializer<KafkaCommittable> getCommittableSerializer() { return new KafkaCommittableSerializer(); }
class KafkaSink<IN> implements StatefulSink<IN, KafkaWriterState>, TwoPhaseCommittingSink<IN, KafkaCommittable> { private final DeliveryGuarantee deliveryGuarantee; private final KafkaRecordSerializationSchema<IN> recordSerializer; private final Properties kafkaProducerConfig; ...
class KafkaSink<IN> implements StatefulSink<IN, KafkaWriterState>, TwoPhaseCommittingSink<IN, KafkaCommittable> { private final DeliveryGuarantee deliveryGuarantee; private final KafkaRecordSerializationSchema<IN> recordSerializer; private final Properties kafkaProducerConfig; ...
With `AssertJ` it would look more natural: ``` assertThat(logManager).isInstanceOf(org.jboss.logmanager.LogManager.class); ```
public void consoleOutputTest() { LogManager logManager = LogManager.getLogManager(); Assertions.assertTrue(logManager instanceof org.jboss.logmanager.LogManager); DelayedHandler delayedHandler = InitialConfigurator.DELAYED_HANDLER; boolean loggerContainsDelayedHandler = Arrays.asList(Lo...
Assertions.assertTrue(logManager instanceof org.jboss.logmanager.LogManager);
public void consoleOutputTest() { LogManager logManager = LogManager.getLogManager(); assertThat(logManager).isInstanceOf(org.jboss.logmanager.LogManager.class); DelayedHandler delayedHandler = InitialConfigurator.DELAYED_HANDLER; assertThat(Logger.getLogger("").getHandlers()).contains(...
class ConsoleHandlerTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addAsResource("application-console-output.properties", "application.properties")); @Test }
class ConsoleHandlerTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addAsResource("application-console-output.properties", "application.properties")); @Test }
Same comment about the iterator here
private static int countMatchingMediaTypes(List<MediaType> produces, List<MediaType> mediaTypes) { int count = 0; for (MediaType mediaType : mediaTypes) { for (MediaType produce : produces) { if (mediaType.isCompatible(produce)) { count++; ...
for (MediaType mediaType : mediaTypes) {
private static int countMatchingMediaTypes(List<MediaType> produces, List<MediaType> mediaTypes) { int count = 0; for (int i = 0; i < mediaTypes.size(); i++) { MediaType mediaType = mediaTypes.get(i); for (int j = 0; j < produces.size(); j++) { MediaType produce =...
class MediaTypeComparator implements Comparator<MediaType>, Serializable { private static final long serialVersionUID = -5828700121582498092L; private final String parameterName; public MediaTypeComparator(String parameterName) { this.parameterName = parameterName; } ...
class MediaTypeComparator implements Comparator<MediaType>, Serializable { private static final long serialVersionUID = -5828700121582498092L; private final String parameterName; public MediaTypeComparator(String parameterName) { this.parameterName = parameterName; } ...
Not all tuples should fail right? Shouldn't we be able to remove all from a tuple with only a rest field? ``` [int...] i = [2, 3]; i.removeAll(); // this is valid? ```
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 ...
I find the way we check the incompatibility confusing atm. There are at least two places that throw a similar exception: 1. `VersionedIOReadeableWritable` from `getIncompatibleVersionError` 2. Here from the `read` method. I think 1) is actually a dead code now, as we tell in `TypeSerializerSnapshotSerializationProxy` ...
public void read(DataInputView in) throws IOException { super.read(in); final int version = getReadVersion(); switch (version) { case 2: serializerSnapshot = deserializeV2(in, userCodeClassLoader); break; ...
version));
public void read(DataInputView in) throws IOException { super.read(in); final int version = getReadVersion(); switch (version) { case 2: serializerSnapshot = deserializeV2(in, userCodeClassLoader); break; ...
class TypeSerializerSnapshotSerializationProxy<T> extends VersionedIOReadableWritable { private static final int VERSION = 2; private ClassLoader userCodeClassLoader; private TypeSerializerSnapshot<T> serializerSnapshot; @Nullable private TypeSerializer<T> serializer; ...
class TypeSerializerSnapshotSerializationProxy<T> extends VersionedIOReadableWritable { private static final int VERSION = 2; private ClassLoader userCodeClassLoader; private TypeSerializerSnapshot<T> serializerSnapshot; /** Constructor for reading serializers. */ ...
Checkpoints are always correct because of following properties: 1) shardIteratorsMap is always in a consistent state, i.e. it is guaranteed to not contain any two shards that are in a parent-child relation. This is a requirement for current logic to properly traverse through splits and merges. 2) All records read from ...
boolean allShardsUpToDate() { boolean shardsUpToDate = true; ImmutableMap<String, ShardRecordsIterator> currentShardIterators = shardIteratorsMap.get(); for (ShardRecordsIterator shardRecordsIterator : currentShardIterators.values()) { shardsUpToDate &= shardRecordsIterator.isUpToDate(); } ret...
shardsUpToDate &= shardRecordsIterator.isUpToDate();
boolean allShardsUpToDate() { boolean shardsUpToDate = true; ImmutableMap<String, ShardRecordsIterator> currentShardIterators = shardIteratorsMap.get(); for (ShardRecordsIterator shardRecordsIterator : currentShardIterators.values()) { shardsUpToDate &= shardRecordsIterator.isUpToDate(); } ret...
class ShardReadersPool { private static final Logger LOG = LoggerFactory.getLogger(ShardReadersPool.class); private static final int DEFAULT_CAPACITY_PER_SHARD = 10_000; /** * Executor service for running the threads that read records from shards handled by this pool. * Each thread runs the {@link ShardRe...
class ShardReadersPool { private static final Logger LOG = LoggerFactory.getLogger(ShardReadersPool.class); private static final int DEFAULT_CAPACITY_PER_SHARD = 10_000; /** * Executor service for running the threads that read records from shards handled by this pool. * Each thread runs the {@link ShardRe...
We usually include `test` in the file. ```suggestion CompileResult result = BCompileUtil.compile("test-src/klass/resource-method-assignability-negative-test.bal"); ``` Not introduced by this PR, but we use underscores in bal file names.
public void testResourceMethodsDoesNotAffectAssignability() { CompileResult result = BCompileUtil.compile("test-src/klass/resource-method-assignability-negative.bal"); int index = 0; validateError(result, index++, "incompatible types: expected 'Foo', found 'Bar'", 38, 13); validateError(...
CompileResult result = BCompileUtil.compile("test-src/klass/resource-method-assignability-negative.bal");
public void testResourceMethodsDoesNotAffectAssignability() { CompileResult result = BCompileUtil.compile("test-src/klass/resource_method_assignability_negative_test.bal"); int index = 0; validateError(result, index++, "incompatible types: expected 'Foo', found 'Bar'", 38, 13); validateE...
class ServiceClassTest { @Test public void testBasicStructAsObject() { CompileResult compileResult = BCompileUtil.compile("test-src/klass/simple_service_class.bal"); BRunUtil.invoke(compileResult, "testServiceObjectValue"); } @Test @Test public void testResourcePathParamN...
class ServiceClassTest { @Test public void testBasicStructAsObject() { CompileResult compileResult = BCompileUtil.compile("test-src/klass/simple_service_class.bal"); BRunUtil.invoke(compileResult, "testServiceObjectValue"); } @Test @Test public void testResourcePathParamN...
There's a compilation error after the parameter type changed to the `CheckpointType` enum.
protected CheckpointingStatistics getTestResponseInstance() throws Exception { final CheckpointingStatistics.Counts counts = new CheckpointingStatistics.Counts(1, 2, 3, 4, 5); final CheckpointingStatistics.Summary summary = new CheckpointingStatistics.Summary( new MinMaxAvgStatistics(1L, 1L, 1L), new MinMaxA...
"Checkpoint",
protected CheckpointingStatistics getTestResponseInstance() throws Exception { final CheckpointingStatistics.Counts counts = new CheckpointingStatistics.Counts(1, 2, 3, 4, 5); final CheckpointingStatistics.Summary summary = new CheckpointingStatistics.Summary( new MinMaxAvgStatistics(1L, 1L, 1L), new MinMaxA...
class CheckpointingStatisticsTest extends RestResponseMarshallingTestBase<CheckpointingStatistics> { @Override protected Class<CheckpointingStatistics> getTestResponseClass() { return CheckpointingStatistics.class; } @Override }
class CheckpointingStatisticsTest extends RestResponseMarshallingTestBase<CheckpointingStatistics> { @Override protected Class<CheckpointingStatistics> getTestResponseClass() { return CheckpointingStatistics.class; } @Override }
There are only three places where BLACKQUOTE is used. This label cannot be added arbitrarily and can only be used behind AS
public String visitSelect(SelectRelation stmt, Void context) { StringBuilder sqlBuilder = new StringBuilder(); SelectList selectList = stmt.getSelectList(); sqlBuilder.append("SELECT "); if (selectList.isDistinct()) { sqlBuilder.append("DISTINCT"); ...
selectListString.add(visit(expr) + " AS `" + toSQL(expr) + "`");
public String visitSelect(SelectRelation stmt, Void context) { StringBuilder sqlBuilder = new StringBuilder(); SelectList selectList = stmt.getSelectList(); sqlBuilder.append("SELECT "); if (selectList.isDistinct()) { sqlBuilder.append("DISTINCT"); ...
class ViewDefBuilderVisitor extends AstVisitor<String, Void> { private ConnectContext session; public ViewDefBuilderVisitor(ConnectContext session) { this.session = session; } @Override public String visitNode(ParseNode node, Void context) { return ""; ...
class ViewDefBuilderVisitor extends AST2SQL.SQLLabelBuilderImpl { @Override public String visitNode(ParseNode node, Void context) { return ""; } @Override @Override public String visitExpression(Expr expr, Void context) { return expr.toS...
`throw new NumberFormatException("invalid id: " + id + " " + e.getMessage());`
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:" + e.getMessage());
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 *...
Missing space between text end and URL
private void validateMajorVersion(TenantAndApplicationId id, Submission submission) { submission.applicationPackage().deploymentSpec().majorVersion().ifPresent(explicitMajor -> { if (explicitMajor < 8) controller.notificationsDb().setNotification(NotificationSource.from(id), ...
"Vespa 7 will soon be end of life, upgrade to Vespa 8 now:" +
private void validateMajorVersion(TenantAndApplicationId id, Submission submission) { submission.applicationPackage().deploymentSpec().majorVersion().ifPresent(explicitMajor -> { if (explicitMajor < 8) controller.notificationsDb().setNotification(NotificationSource.from(id), ...
class JobController { public static final Duration maxHistoryAge = Duration.ofDays(60); private static final Logger log = Logger.getLogger(JobController.class.getName()); private final int historyLength; private final Controller controller; private final CuratorDb curator; private final Buffe...
class JobController { public static final Duration maxHistoryAge = Duration.ofDays(60); private static final Logger log = Logger.getLogger(JobController.class.getName()); private final int historyLength; private final Controller controller; private final CuratorDb curator; private final Buffe...
Now we need to check for null here too.
private void ensureClusterTableIsUpdated() { try { if (0 == engine.get().getStatus(newContext().getCairoSecurityContext(), new Path(), clusterTable.name)) { } } catch (Exception e) { clusterTable.repair(e); } }
if (0 == engine.get().getStatus(newContext().getCairoSecurityContext(), new Path(), clusterTable.name)) {
private void ensureClusterTableIsUpdated() { try { if (0 == engine().getStatus(newContext().getCairoSecurityContext(), new Path(), clusterTable.name)) { } } catch (Exception e) { clusterTable.repair(e); } }
class QuestMetricsDb extends AbstractComponent implements MetricsDb { private static final Logger log = Logger.getLogger(QuestMetricsDb.class.getName()); private final Table nodeTable; private final Table clusterTable; private final Clock clock; private final String dataDir; private final Ato...
class QuestMetricsDb extends AbstractComponent implements MetricsDb { private static final Logger log = Logger.getLogger(QuestMetricsDb.class.getName()); private final Table nodeTable; private final Table clusterTable; private final Clock clock; private final String dataDir; private final Cai...
Do you mean I added a log message before throw statement. Done.
public URL getQueueUrl() { try { return new URL(client.url()); } catch (MalformedURLException ex) { throw new RuntimeException("Queue URL is malformed"); } }
throw new RuntimeException("Queue URL is malformed");
public URL getQueueUrl() { try { return new URL(client.url()); } catch (MalformedURLException ex) { LOGGER.asError().log("Queue URL is malformed"); throw new RuntimeException("Queue URL is malformed"); } }
class QueueAsyncClient { private final AzureQueueStorageImpl client; private final String queueName; /** * Creates a QueueAsyncClient that sends requests to the storage queue service at {@link AzureQueueStorageImpl * Each service call goes through the {@link HttpPipeline pipeline} in the {@code c...
class QueueAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(QueueAsyncClient.class); private final AzureQueueStorageImpl client; private final String queueName; /** * Creates a QueueAsyncClient that sends requests to the storage queue service at {@code AzureQueueStorageImp...
<!--thread_id:cc_182613813_t; commit:a16a978c74d440d81ca78b3c44be72eae312ef74; resolved:1--> <!--section:context-quote--> > **tgroh** wrote: > Why is this uninterruptible? <!--section:body--> To ensure that we sleep fully for the amount of time requested. Given that we don't use interrupts anywhere in Beam code, we do...
public State waitUntilFinish(Duration duration) { if (duration.compareTo(Duration.millis(1)) < 1) { return waitUntilFinish(); } else { CompletableFuture<State> result = CompletableFuture.supplyAsync(this::waitUntilFinish); try { return Uninterruptibles.getUninterruptibly( ...
return Uninterruptibles.getUninterruptibly(
public State waitUntilFinish(Duration duration) { if (duration.compareTo(Duration.millis(1)) < 1) { return waitUntilFinish(); } else { CompletableFuture<State> result = CompletableFuture.supplyAsync(this::waitUntilFinish); try { return result.get(duration.getMillis(), TimeUnit.M...
class JobServicePipelineResult implements PipelineResult { private static final long POLL_INTERVAL_SEC = 10; private static final Logger LOG = LoggerFactory.getLogger(JobServicePipelineResult.class); private final ByteString jobId; private final CloseableResource<JobServiceBlockingStub> jobService; JobSer...
class JobServicePipelineResult implements PipelineResult { private static final long POLL_INTERVAL_MS = 10 * 1000; private static final Logger LOG = LoggerFactory.getLogger(JobServicePipelineResult.class); private final ByteString jobId; private final CloseableResource<JobServiceBlockingStub> jobService; ...
Hehe. You don't have a bad point.
public Optional<String> oldestIncompleteResultId() { synchronized (monitor) { return Optional.of(docSendInfoByOperationId.keySet().iterator()) .filter(Iterator::hasNext) .map(Iterator::next); } }
return Optional.of(docSendInfoByOperationId.keySet().iterator())
public Optional<String> oldestIncompleteResultId() { synchronized (monitor) { return docSendInfoByOperationId.isEmpty() ? Optional.empty() : Optional.of(docSendInfoByOperationId.keySet().iterator().next()); } }
class OperationProcessor { private static final Logger log = Logger.getLogger(OperationProcessor.class.getName()); private final Map<String, DocumentSendInfo> docSendInfoByOperationId = new LinkedHashMap<>(); private final ArrayListMultimap<String, Document> blockedDocumentsByDocumentId = ArrayListMultimap...
class OperationProcessor { private static final Logger log = Logger.getLogger(OperationProcessor.class.getName()); private final Map<String, DocumentSendInfo> docSendInfoByOperationId = new LinkedHashMap<>(); private final ArrayListMultimap<String, Document> blockedDocumentsByDocumentId = ArrayListMultimap...
```suggestion List<PrivEntry> userPrivEntryList = map.get(userIdentity); ```
public void dropEntry(PrivEntry entry) { UserIdentity userIdentity = entry.getUserIdent(); List<PrivEntry> userPrivEntryList = map.get(entry.getUserIdent()); if (userPrivEntryList == null) { return; } Iterator<PrivEntry> iter = userPrivEntryList.iterator(); wh...
List<PrivEntry> userPrivEntryList = map.get(entry.getUserIdent());
public void dropEntry(PrivEntry entry) { UserIdentity userIdentity = entry.getUserIdent(); List<PrivEntry> userPrivEntryList = map.get(userIdentity); if (userPrivEntryList == null) { return; } Iterator<PrivEntry> iter = userPrivEntryList.iterator(); while (ite...
class PrivTable implements Writable { private static final Logger LOG = LogManager.getLogger(PrivTable.class); protected Map<UserIdentity, List<PrivEntry>> map = new TreeMap<>(new Comparator<UserIdentity>() { @Override public int compare(UserIdentity o1, UserIdentity o2) { int ...
class PrivTable implements Writable { private static final Logger LOG = LogManager.getLogger(PrivTable.class); protected Map<UserIdentity, List<PrivEntry>> map = new TreeMap<>(new Comparator<UserIdentity>() { @Override public int compare(UserIdentity o1, UserIdentity o2) { int ...
Hello @gastaldi, in this specific testcase I was just interested in seeing if the `Multi-Release: true` attribtue made it into the jar file and for that test, using any variant of `JarFile` constructor and then calling the `isMultiRelease()` works fine.
private void verifyUberJar() throws IOException { final File targetDir = getTargetDir(); List<File> jars = getFilesEndingWith(targetDir, ".jar"); assertThat(jars).hasSize(1); assertThat(getNumberOfFilesEndingWith(targetDir, ".original")).isEqualTo(1); try (JarFile jarFile = new J...
try (JarFile jarFile = new JarFile(jars.get(0))) {
private void verifyUberJar() throws IOException { final File targetDir = getTargetDir(); List<File> jars = getFilesEndingWith(targetDir, ".jar"); assertThat(jars).hasSize(1); assertThat(getNumberOfFilesEndingWith(targetDir, ".original")).isEqualTo(1); try (JarFile jarFile = new J...
class PackageIT extends MojoTestBase { private RunningInvoker running; private File testDir; @Test public void testUberJarMavenPluginConfiguration() throws MavenInvocationException, IOException, InterruptedException { testDir = initProject("projects/uberjar-maven-plugin-config"); ...
class PackageIT extends MojoTestBase { private RunningInvoker running; private File testDir; @Test public void testUberJarMavenPluginConfiguration() throws MavenInvocationException, IOException, InterruptedException { testDir = initProject("projects/uberjar-maven-plugin-config"); ...
Yes `super.trySplit()` handles empty range. The special case here is to handle `range.getTo() == range.getFrom == Long.MAX_VALUE`.
public SplitResult<OffsetRange> trySplit(double fractionOfRemainder) { if (range.getTo() != Long.MAX_VALUE || range.getTo() == range.getFrom()) { return super.trySplit(fractionOfRemainder); } long cur = (lastAttemptedOffset == null) ? range.getFrom() - 1 : lastAttemptedOffset; if (cur =...
1L,
public SplitResult<OffsetRange> trySplit(double fractionOfRemainder) { if (range.getTo() != Long.MAX_VALUE || range.getTo() == range.getFrom()) { return super.trySplit(fractionOfRemainder); } if (lastAttemptedOffset != null && lastAttemptedOffset == Long.MAX_VALUE) { return null; }...
class GrowableOffsetRangeTracker extends OffsetRangeTracker { /** * An interface that should be implemented to fetch estimated end offset of range. * * <p>{@code estimateRangeEnd} is called to give te end offset when {@code trySplit} or {@code * getProgress} is invoked. The end offset is exclusive for the...
class GrowableOffsetRangeTracker extends OffsetRangeTracker { /** * Provides the estimated end offset of the range. * * <p>{@link * * required to monotonically increase as it will only be taken into consideration when the * estimated end offset is larger than the current position. Returning {@code...
Guilty as charged! Should be fixed now :)
protected void implementIfExistsGetReception(ClassCreator observerCreator) { MethodCreator getObservedType = observerCreator.getMethodCreator("getReception", Reception.class) .setModifiers(ACC_PUBLIC); getObservedType.returnValue(getObservedType.load(Reception.IF_EXISTS)); }
getObservedType.returnValue(getObservedType.load(Reception.IF_EXISTS));
protected void implementIfExistsGetReception(ClassCreator observerCreator) { MethodCreator getReception = observerCreator.getMethodCreator("getReception", Reception.class) .setModifiers(ACC_PUBLIC); getReception.returnValue(getReception.load(Reception.IF_EXISTS)); }
class name " + generatedName + " already exists for " + generatedObserver); } else { return Collections.emptyList(); }
class name " + generatedName + " already exists for " + generatedObserver); } else { return Collections.emptyList(); }
But it should. Even the `tsymbol.type` can be a reference type eg ```ballerina type Foo int; type Bar Foo; public function foo() returns Bar { return 1; } ```
private void checkForExportableType(BTypeSymbol symbol, Location pos, HashSet<BTypeSymbol> visitedSymbols) { if (symbol == null || symbol.type == null || Symbols.isFlagOn(symbol.flags, Flags.TYPE_PARAM)) { return; } if (!visitedSymbols.add(symbol)) { return;...
checkForExportableType((((BErrorType) symbolType).detailType.tsymbol), pos, visitedSymbols);
private void checkForExportableType(BTypeSymbol symbol, Location pos, HashSet<BTypeSymbol> visitedSymbols) { if (symbol == null || symbol.type == null || Symbols.isFlagOn(symbol.flags, Flags.TYPE_PARAM)) { return; } if (!visitedSymbols.add(symbol)) { return;...
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; ...
nit: you don't need to specify `this`. There is no other variable declared in this scope with the same name.
public int maxRetryCount() { return this.maxRetryCount; }
return this.maxRetryCount;
public int maxRetryCount() { return maxRetryCount; }
class Retry { public static final Duration DEFAULT_RETRY_MIN_BACKOFF = Duration.ofSeconds(0); public static final Duration DEFAULT_RETRY_MAX_BACKOFF = Duration.ofSeconds(30); public static final int DEFAULT_MAX_RETRY_COUNT = 10; private final AtomicInteger retryCount = new AtomicInteger(); private...
class Retry { public static final Duration DEFAULT_RETRY_MIN_BACKOFF = Duration.ofSeconds(0); public static final Duration DEFAULT_RETRY_MAX_BACKOFF = Duration.ofSeconds(30); public static final int DEFAULT_MAX_RETRY_COUNT = 10; private final AtomicInteger retryCount = new AtomicInteger(); private...
```suggestion return exprNode.isPresent()? exprNode : Optional.empty(); ``` Is this further simplification possible?
public Optional<ExpressionNode> findExpression(Node node) { if (node == null) { return Optional.empty(); } Optional<ExpressionNode> exprNode = node.apply(this); if (exprNode == null) { return Optional.empty(); } return exprNode; ...
return exprNode;
public Optional<ExpressionNode> findExpression(Node node) { if (node == null) { return Optional.empty(); } Optional<ExpressionNode> exprNode = node.apply(this); return exprNode == null ? Optional.empty() : exprNode; }
class MatchedExpressionNodeResolver extends NodeTransformer<Optional<ExpressionNode>> { Node matchedNode; public MatchedExpressionNodeResolver(Node matchedNode) { this.matchedNode = matchedNode; } /** * Given the node, this method returns the optional expression in which the provided nod...
class MatchedExpressionNodeResolver extends NodeTransformer<Optional<ExpressionNode>> { Node matchedNode; public MatchedExpressionNodeResolver(Node matchedNode) { this.matchedNode = matchedNode; } /** * Given the node, this method returns the optional expression in which the provided nod...
Please also fix same issue further down in `getShardIterator` (https://github.com/apache/flink/pull/7706/files#diff-ed02b5340df65de06c19eb93fe90a920L340)
public GetRecordsResult getRecords(String shardIterator, int maxRecordsToGet) throws InterruptedException { final GetRecordsRequest getRecordsRequest = new GetRecordsRequest(); getRecordsRequest.setShardIterator(shardIterator); getRecordsRequest.setLimit(maxRecordsToGet); GetRecordsResult getRecordsResult = nu...
throw new RuntimeException("Retries exceeded for getRecords operation - all " + getRecordsMaxRetries +
public GetRecordsResult getRecords(String shardIterator, int maxRecordsToGet) throws InterruptedException { final GetRecordsRequest getRecordsRequest = new GetRecordsRequest(); getRecordsRequest.setShardIterator(shardIterator); getRecordsRequest.setLimit(maxRecordsToGet); GetRecordsResult getRecordsResult = nu...
class KinesisProxy implements KinesisProxyInterface { private static final Logger LOG = LoggerFactory.getLogger(KinesisProxy.class); /** The actual Kinesis client from the AWS SDK that we will be using to make calls. */ private final AmazonKinesis kinesisClient; /** Random seed used to calculate backoff jitter f...
class KinesisProxy implements KinesisProxyInterface { private static final Logger LOG = LoggerFactory.getLogger(KinesisProxy.class); /** The actual Kinesis client from the AWS SDK that we will be using to make calls. */ private final AmazonKinesis kinesisClient; /** Random seed used to calculate backoff jitter f...
This check won't always work as expected and won't comply with the changes made in PR #4194.
public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } if (canLogAtLevel(level)) { logger.error("", runtimeException); } throw runtimeException; }
if (canLogAtLevel(level)) {
public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } if (canLogAtLevel(ERROR_LEVEL)) { logger.error(runtimeException.getMessage(), runtimeException); } throw runtimeException; }
class name using the {@link LoggerFactory}
class name using the {@link LoggerFactory}
third param can be non-literal?
public static void verifyAnalyticExpression(AnalyticExpr analyticExpr) { for (Expr e : analyticExpr.getPartitionExprs()) { if (e.isConstant()) { throw new SemanticException("Expressions in the PARTITION BY clause must not be constant: " + e.toSql() + " (in " +...
if (!analyticFunction.getChild(2).isLiteral() && analyticFunction.getChild(2).isNullable()) {
public static void verifyAnalyticExpression(AnalyticExpr analyticExpr) { for (Expr e : analyticExpr.getPartitionExprs()) { if (e.isConstant()) { throw new SemanticException("Expressions in the PARTITION BY clause must not be constant: " + e.toSql() + " (in " +...
class AnalyticAnalyzer { private static boolean isPositiveConstantInteger(Expr expr) { if (!expr.isConstant()) { return false; } double value = 0; if (expr instanceof IntLiteral) { IntLiteral intl = (IntLiteral) expr; value = intl.getDoubleV...
class AnalyticAnalyzer { private static boolean isPositiveConstantInteger(Expr expr) { if (!expr.isConstant()) { return false; } double value = 0; if (expr instanceof IntLiteral) { IntLiteral intl = (IntLiteral) expr; value = intl.getDoubleV...
is it better to set it as not materialized instead of remove it?
public void substitutePreRepeatExprs(ExprSubstitutionMap smap, Analyzer analyzer) { ArrayList<Expr> originalPreRepeatExprs = new ArrayList<>(preRepeatExprs); preRepeatExprs = Expr.substituteList(preRepeatExprs, smap, analyzer, true); ArrayList<Expr> materializedPreRepeatExprs = new Arr...
outputTupleDesc.getSlots().remove(((SlotRef) rExpr).getDesc());
public void substitutePreRepeatExprs(ExprSubstitutionMap smap, Analyzer analyzer) { ArrayList<Expr> originalPreRepeatExprs = new ArrayList<>(preRepeatExprs); preRepeatExprs = Expr.substituteList(preRepeatExprs, smap, analyzer, true); ArrayList<Expr> materializedPreRepeatExprs = new Arr...
class GroupingInfo { public static final String COL_GROUPING_ID = "GROUPING_ID"; public static final String GROUPING_PREFIX = "GROUPING_PREFIX_"; private VirtualSlotRef groupingIDSlot; private TupleDescriptor virtualTuple; private TupleDescriptor outputTupleDesc; private ExprSubstitutionMap outp...
class GroupingInfo { public static final String COL_GROUPING_ID = "GROUPING_ID"; public static final String GROUPING_PREFIX = "GROUPING_PREFIX_"; private VirtualSlotRef groupingIDSlot; private TupleDescriptor virtualTuple; private TupleDescriptor outputTupleDesc; private ExprSubstitutionMap outp...
Oh, oh, I get the idea
private String getShardingColumn(final ShardingStrategyConfiguration shardingStrategyConfig) { if (shardingStrategyConfig instanceof ComplexShardingStrategyConfiguration) { return ((ComplexShardingStrategyConfiguration) shardingStrategyConfig).getShardingColumns(); } if (shardingStra...
return ((ComplexShardingStrategyConfiguration) shardingStrategyConfig).getShardingColumns();
private String getShardingColumn(final ShardingStrategyConfiguration shardingStrategyConfig) { String shardingColumn = defaultShardingColumn; if (shardingStrategyConfig instanceof ComplexShardingStrategyConfiguration) { shardingColumn = ((ComplexShardingStrategyConfiguration) shardingStrateg...
class ShardingRule implements SchemaRule, DataNodeContainedRule, TableContainedRule, InstanceAwareRule { private static final String EQUAL = "="; static { ShardingSphereServiceLoader.register(ShardingAlgorithm.class); ShardingSphereServiceLoader.register(KeyGenerateAlgorithm.class); ...
class ShardingRule implements SchemaRule, DataNodeContainedRule, TableContainedRule, InstanceAwareRule { private static final String EQUAL = "="; static { ShardingSphereServiceLoader.register(ShardingAlgorithm.class); ShardingSphereServiceLoader.register(KeyGenerateAlgorithm.class); ...
We need to close the FileInputStream once we done use it.
private static SSLContext getSSLContext(MapValue secureSocket) { final String CERT_PASS = "password"; final String CERT_PATH = "path"; try { MapValue cryptoKeyStore = secureSocket.getMapValue(RabbitMQConstants.RABBITMQ_CONNECTION_KEYSTORE); MapValue cryptoTrustStore = sec...
keyStore.load(new FileInputStream(keyFilePath), keyPassphrase);
private static SSLContext getSSLContext(MapValue secureSocket) { try { MapValue cryptoKeyStore = secureSocket.getMapValue(RabbitMQConstants.RABBITMQ_CONNECTION_KEYSTORE); MapValue cryptoTrustStore = secureSocket.getMapValue(RabbitMQConstants.RABBITMQ_CONNECTION_TRUSTORE); cha...
class ConnectionUtils { private static final Logger logger = LoggerFactory.getLogger(ConnectionUtils.class); /** * Creates a RabbitMQ Connection using the given connection parameters. * * @param connectionConfig Parameters used to initialize the connection. * @return RabbitMQ Connection obj...
class ConnectionUtils { private static final Logger logger = LoggerFactory.getLogger(ConnectionUtils.class); /** * Creates a RabbitMQ Connection using the given connection parameters. * * @param connectionConfig Parameters used to initialize the connection. * @return RabbitMQ Connection obj...
Consider creating a new method on tester that allows creating a tenant with a given access role or helper method to update access role so we dont test REST API here, plus it'll be much faster.
public void grantsRoleAccess() { var containerTester = new ContainerTester(container, ""); ((InMemoryFlagSource) containerTester.controller().flagSource()) .withBooleanFlag(PermanentFlags.ENABLE_PUBLIC_SIGNUP_FLOW.id(), true); var tester = new ControllerTester(containerTester); ...
containerTester.assertResponse(request("/application/v4/tenant/tenant1/archive-access", PUT)
public void grantsRoleAccess() { var containerTester = new ContainerTester(container, ""); ((InMemoryFlagSource) containerTester.controller().flagSource()) .withBooleanFlag(PermanentFlags.ENABLE_PUBLIC_SIGNUP_FLOW.id(), true) .withStringFlag(Flags.SYNC_HOST_LOGS_TO_S3_BUC...
class ArchiveAccessMaintainerTest extends ControllerContainerCloudTest { @Test }
class ArchiveAccessMaintainerTest extends ControllerContainerCloudTest { @Test private TenantName createTenantWithAccessRole(ControllerTester tester, String tenantName, String role) { var tenant = tester.createTenant(tenantName, Tenant.Type.cloud); tester.controller().tenants().lockOrThro...
Would like me to throw the exception after all @gsmet?
private void createMavenWrapper() { try { executeMojo( plugin( groupId("io.takari"), artifactId("maven"), version(MojoUtils.getMavenWrapperVersion())), goal("wrapper"), ...
getLog().debug("Unable to create Maven Wrapper");
private void createMavenWrapper() { try { executeMojo( plugin( groupId("io.takari"), artifactId("maven"), version(MojoUtils.getMavenWrapperVersion())), goal("wrapper"), ...
class CreateProjectMojo extends AbstractMojo { public static final String PLUGIN_KEY = MojoUtils.getPluginGroupId() + ":" + MojoUtils.getPluginArtifactId(); private static final String DEFAULT_GROUP_ID = "org.acme.quarkus.sample"; @Parameter(defaultValue = "${project}") protected MavenProject project...
class CreateProjectMojo extends AbstractMojo { public static final String PLUGIN_KEY = MojoUtils.getPluginGroupId() + ":" + MojoUtils.getPluginArtifactId(); private static final String DEFAULT_GROUP_ID = "org.acme.quarkus.sample"; @Parameter(defaultValue = "${project}") protected MavenProject project...
Keep in mind that when you inject the stage version of the session, it will be eagerly created. So the Mutiny version is not less efficient. I had a look at the session implementation code. It seems that a connection is acquired as soon as the session is created. Perhaps this should be delayed until a connection is ac...
public void disposeMutinySession(@Disposes Uni<Mutiny.Session> reactiveSession) { reactiveSession.subscribe().with(Mutiny.Session::close); }
reactiveSession.subscribe().with(Mutiny.Session::close);
public void disposeMutinySession(@Disposes Uni<Mutiny.Session> reactiveSession) { reactiveSession.subscribe().with(Mutiny.Session::close); }
class ReactiveSessionProducer { @Inject private Stage.SessionFactory reactiveSessionFactory; @Inject private Mutiny.SessionFactory mutinySessionFactory; @Produces @RequestScoped @DefaultBean public CompletionStage<Stage.Session> stageSession() { return reactiveSessionFactory.o...
class ReactiveSessionProducer { @Inject private Stage.SessionFactory reactiveSessionFactory; @Inject private Mutiny.SessionFactory mutinySessionFactory; @Produces @RequestScoped @DefaultBean public CompletionStage<Stage.Session> stageSession() { return reactiveSessionFactory.o...
Only targeted for tests - setting a JSON environment variable value through command-line in `live-platform-matrix.json` never seemed to work for some reason. This seemed like a simple compromise and the newly added system property is hidden. Let me know if you disagree - I can investigate how to set it as JSON directly...
CosmosAsyncClient buildAsyncClient(boolean logStartupInfo) { StopWatch stopwatch = new StopWatch(); stopwatch.start(); if (Configs.shouldOptInDefaultCircuitBreakerConfig()) { if (Configs.shouldOptInDefaultCircuitBreakerConfig()) { System.setProperty("COSMOS.PARTITIO...
if (Configs.shouldOptInDefaultCircuitBreakerConfig()) {
CosmosAsyncClient buildAsyncClient(boolean logStartupInfo) { StopWatch stopwatch = new StopWatch(); stopwatch.start(); if (Configs.shouldOptInDefaultCircuitBreakerConfig()) { System.setProperty("COSMOS.PARTITION_LEVEL_CIRCUIT_BREAKER_CONFIG", "{\"isPartitionLevelCircuitBreakerEnable...
class to instantiate {@link CosmosContainerProactiveInitConfig}
class to instantiate {@link CosmosContainerProactiveInitConfig}
The most risky bug in this code is: Potential ClassCastException when casting `Table` to `IcebergTable`. You can modify the code like this: ```java @@ -515,6 +516,17 @@ private IcebergSplitScanTask buildIcebergSplitScanTask( @Override public void refreshTable(String srDbName, Table table, List<String> partiti...
private void refreshTableWithResource(Table table) { IcebergTable icebergTable = (IcebergTable) table; org.apache.iceberg.Table nativeTable = icebergTable.getNativeTable(); try { if (nativeTable instanceof BaseTable) { BaseTable baseTable = (BaseTable) nativeTable; ...
throw new StarRocksConnectorException("No such table %s", nativeTable.name());
private void refreshTableWithResource(Table table) { IcebergTable icebergTable = (IcebergTable) table; org.apache.iceberg.Table nativeTable = icebergTable.getNativeTable(); try { if (nativeTable instanceof BaseTable) { BaseTable baseTable = (BaseTable) nativeTable; ...
class IcebergMetadata implements ConnectorMetadata { private static final Logger LOG = LogManager.getLogger(IcebergMetadata.class); private final String catalogName; private final HdfsEnvironment hdfsEnvironment; private final IcebergCatalog icebergCatalog; private final IcebergStatisticProvider st...
class IcebergMetadata implements ConnectorMetadata { private static final Logger LOG = LogManager.getLogger(IcebergMetadata.class); private final String catalogName; private final HdfsEnvironment hdfsEnvironment; private final IcebergCatalog icebergCatalog; private final IcebergStatisticProvider st...
Please check whether there is simiar issue here. Thx.
public ASTNode visitShowColumns(final ShowColumnsContext ctx) { ShowColumnsStatement result = new ShowColumnsStatement(); FromTableContext fromTableContext = ctx.fromTable(); FromSchemaContext fromSchemaContext = ctx.fromSchema(); ShowLikeContext showLikeContext = ctx.showLike(); ...
FromTableSegment fromTableSegment = (FromTableSegment) visit(fromTableContext);
public ASTNode visitShowColumns(final ShowColumnsContext ctx) { ShowColumnsStatement result = new ShowColumnsStatement(); FromTableContext fromTableContext = ctx.fromTable(); FromSchemaContext fromSchemaContext = ctx.fromSchema(); ShowLikeContext showLikeContext = ctx.showLike(); ...
class MySQLVisitor extends MySQLStatementBaseVisitor<ASTNode> implements SQLVisitor { private int currentParameterIndex; @Override public ASTNode visitUse(final UseContext ctx) { LiteralValue schema = (LiteralValue) visit(ctx.schemaName()); UseStatement result = new UseStateme...
class MySQLVisitor extends MySQLStatementBaseVisitor<ASTNode> implements SQLVisitor { private int currentParameterIndex; @Override public ASTNode visitUse(final UseContext ctx) { LiteralValue schema = (LiteralValue) visit(ctx.schemaName()); UseStatement result = new UseStateme...
Yeah, I agree. It may have some thread-safe problem. I will update this part.
public CompletableFuture<Void> createTaskManagerPod(KubernetesPod kubernetesPod) { if (masterDeployment == null) { masterDeployment = this.internalClient .apps() .deployments() .withName(Kubernete...
if (masterDeployment == null) {
public CompletableFuture<Void> createTaskManagerPod(KubernetesPod kubernetesPod) { return CompletableFuture.runAsync( () -> { if (masterDeploymentRef.get() == null) { final Deployment masterDeployment = this.internalClie...
class Fabric8FlinkKubeClient implements FlinkKubeClient { private static final Logger LOG = LoggerFactory.getLogger(Fabric8FlinkKubeClient.class); private final String clusterId; private final String namespace; private final int maxRetryAttempts; private final KubernetesConfigOptions.NodePortAddre...
class Fabric8FlinkKubeClient implements FlinkKubeClient { private static final Logger LOG = LoggerFactory.getLogger(Fabric8FlinkKubeClient.class); private final String clusterId; private final String namespace; private final int maxRetryAttempts; private final KubernetesConfigOptions.NodePortAddre...
But that enum constant I don't see!
public FeatureFlags(FlagSource source, ApplicationId appId) { this.defaultTermwiseLimit = flagValue(source, appId, Flags.DEFAULT_TERM_WISE_LIMIT); this.useThreePhaseUpdates = flagValue(source, appId, Flags.USE_THREE_PHASE_UPDATES); this.feedSequencer = flagValue(source, appId, Flags....
this.clusterControllerMaxHeapSizeInMb = flagValue(source, appId, Flags.CLUSTER_CONTROLLER_MAX_HEAP_SIZE_IN_MB);
public FeatureFlags(FlagSource source, ApplicationId appId) { this.defaultTermwiseLimit = flagValue(source, appId, Flags.DEFAULT_TERM_WISE_LIMIT); this.useThreePhaseUpdates = flagValue(source, appId, Flags.USE_THREE_PHASE_UPDATES); this.feedSequencer = flagValue(source, appId, Flags....
class FeatureFlags implements ModelContext.FeatureFlags { private final double defaultTermwiseLimit; private final boolean useThreePhaseUpdates; private final String feedSequencer; private final String responseSequencer; private final int numResponseThreads; private fina...
class FeatureFlags implements ModelContext.FeatureFlags { private final double defaultTermwiseLimit; private final boolean useThreePhaseUpdates; private final String feedSequencer; private final String responseSequencer; private final int numResponseThreads; private fina...
Different variables has different upper limits
private void checkRangeLongVariable(String field, Long min, Long max) { String value = getResolvedExpression().getStringValue(); try { long num = Long.parseLong(value); if (min != null && num < min) { throw new SemanticException(String.format("%s must be equal or ...
if (max != null && num > max) {
private void checkRangeLongVariable(String field, Long min, Long max) { String value = getResolvedExpression().getStringValue(); try { long num = Long.parseLong(value); if (min != null && num < min) { throw new SemanticException(String.format("%s must be equal or ...
class SetVar implements ParseNode { private String variable; private SetType type; private Expr expression; private LiteralExpr resolvedExpression; public SetVar() { } public SetVar(SetType type, String variable, Expr expression) { this.type = type; this.variable = variabl...
class SetVar implements ParseNode { private String variable; private SetType type; private Expr expression; private LiteralExpr resolvedExpression; public SetVar() { } public SetVar(SetType type, String variable, Expr expression) { this.type = type; this.variable = variabl...
It wouldn't reduce actual number of lines, but it would reduce the amount of duplicated code a bit (one line can have more embedded logic then the another one). For example after changing from `int[] selectChannels(...)` to `int selectChannel(...)` you would have 6 fewer places to fix. But as I wrote before, I'm not s...
public void testSelectChannelsInterval() { sd.setInstance(streamRecord); assertEquals(0, streamPartitioner.selectChannels(sd, 1)[0]); assertEquals(0, streamPartitioner.selectChannels(sd, 2)[0]); assertEquals(0, streamPartitioner.selectChannels(sd, 1024)[0]); }
assertEquals(0, streamPartitioner.selectChannels(sd, 1)[0]);
public void testSelectChannelsInterval() { assertSelectedChannel(0, 1); assertSelectedChannel(0, 2); assertSelectedChannel(0, 1024); }
class ForwardPartitionerTest extends StreamPartitionerTest { @Before public void setPartitioner() { streamPartitioner = new ForwardPartitioner<>(); } @Test }
class ForwardPartitionerTest extends StreamPartitionerTest { @Override public StreamPartitioner<Tuple> createPartitioner() { return new ForwardPartitioner<>(); } @Test }
It doesn't make a difference because the watermark is always the minimum across all readers. In case of the `UnboundedReadFromBoundedSource` adapter, all input is read from all sources and only then the watermark is progressed. See: https://github.com/apache/beam/commit/11d9ec5ebff4820b36db4b6ea4df7a0f79115ddd#diff-6b...
public void run(SourceContext<WindowedValue<ValueWithRecordId<OutputT>>> ctx) throws Exception { context = ctx; FlinkMetricContainer metricContainer = new FlinkMetricContainer(getRuntimeContext()); ReaderInvocationUtil<OutputT, UnboundedSource.UnboundedReader<OutputT>> readerInvoker = new ReaderI...
public void run(SourceContext<WindowedValue<ValueWithRecordId<OutputT>>> ctx) throws Exception { context = ctx; FlinkMetricContainer metricContainer = new FlinkMetricContainer(getRuntimeContext()); ReaderInvocationUtil<OutputT, UnboundedSource.UnboundedReader<OutputT>> readerInvoker = new ReaderI...
class UnboundedSourceWrapper<OutputT, CheckpointMarkT extends UnboundedSource.CheckpointMark> extends RichParallelSourceFunction<WindowedValue<ValueWithRecordId<OutputT>>> implements ProcessingTimeCallback, StoppableFunction, CheckpointListener, CheckpointedFunction { private static final Logger LOG = Logger...
class UnboundedSourceWrapper<OutputT, CheckpointMarkT extends UnboundedSource.CheckpointMark> extends RichParallelSourceFunction<WindowedValue<ValueWithRecordId<OutputT>>> implements ProcessingTimeCallback, StoppableFunction, CheckpointListener, CheckpointedFunction { private static final Logger LOG = Logger...
The returned value is only the instance name, since it returns the last path segment
public static Optional<String> getInstanceName(List<SubjectAlternativeName> sans) { return getLastSegmentFromSanUri(sans, "athenz: }
return getLastSegmentFromSanUri(sans, "athenz:
public static Optional<String> getInstanceName(List<SubjectAlternativeName> sans) { return getLastSegmentFromSanUri(sans, "athenz: }
class AthenzX509CertificateUtils { private AthenzX509CertificateUtils() {} public static AthenzIdentity getIdentityFromRoleCertificate(X509Certificate certificate) { List<SubjectAlternativeName> sans = X509CertificateUtils.getSubjectAlternativeNames(certificate); return getRoleIdentityFromEmai...
class AthenzX509CertificateUtils { private AthenzX509CertificateUtils() {} public static AthenzIdentity getIdentityFromRoleCertificate(X509Certificate certificate) { List<SubjectAlternativeName> sans = X509CertificateUtils.getSubjectAlternativeNames(certificate); return getRoleIdentityFromEmai...
Use `params` from above instead of reading all bytes again?
protected HttpResponse handlePOST(HttpRequest request) { validateDataAndHeader(request, List.of(APPLICATION_X_GZIP, APPLICATION_ZIP, MULTIPART_FORM_DATA)); TenantName tenantName = validateTenant(request); PrepareParams prepareParams; CompressedApplicationInputStream compressedStream; ...
prepareParams = PrepareParams.fromJson(parts.get(MULTIPART_PARAMS).getInputStream().readAllBytes(), tenantName, zookeeperBarrierTimeout);
protected HttpResponse handlePOST(HttpRequest request) { validateDataAndHeader(request, List.of(APPLICATION_X_GZIP, APPLICATION_ZIP, MULTIPART_FORM_DATA)); TenantName tenantName = validateTenant(request); PrepareParams prepareParams; CompressedApplicationInputStream compressedStream; ...
class ApplicationApiHandler extends SessionHandler { public final static String APPLICATION_X_GZIP = "application/x-gzip"; public final static String APPLICATION_ZIP = "application/zip"; public final static String MULTIPART_FORM_DATA = "multipart/form-data"; public final static String MULTIPART_PARAMS ...
class ApplicationApiHandler extends SessionHandler { public final static String APPLICATION_X_GZIP = "application/x-gzip"; public final static String APPLICATION_ZIP = "application/zip"; public final static String MULTIPART_FORM_DATA = "multipart/form-data"; public final static String MULTIPART_PARAMS ...
```suggestion Objects.requireNonNull(decryptParameters, "'decryptParameters' cannot be null"); ```
public Mono<DecryptResult> decrypt(DecryptParameters decryptParameters) { Objects.requireNonNull(decryptParameters, "'decryptOptions' cannot be null"); try { return withContext(context -> decrypt(decryptParameters, context)); } catch (RuntimeException ex) { return monoEr...
Objects.requireNonNull(decryptParameters, "'decryptOptions' cannot be null");
public Mono<DecryptResult> decrypt(DecryptParameters decryptParameters) { Objects.requireNonNull(decryptParameters, "'decryptParameters' cannot be null"); try { return withContext(context -> decrypt(decryptParameters, context)); } catch (RuntimeException ex) { return mon...
class CryptographyAsyncClient { static final String KEY_VAULT_SCOPE = "https: static final String SECRETS_COLLECTION = "secrets"; static final String KEYVAULT_TRACING_NAMESPACE_VALUE = "Microsoft.KeyVault"; JsonWebKey key; private final CryptographyService service; private Cryptograph...
class CryptographyAsyncClient { static final String KEY_VAULT_SCOPE = "https: static final String SECRETS_COLLECTION = "secrets"; static final String KEYVAULT_TRACING_NAMESPACE_VALUE = "Microsoft.KeyVault"; JsonWebKey key; private final CryptographyService service; private Cryptograph...
@cescoffier: I switched to using the string version as you suggested. When adding the deployment dependencies, the build didn't work anymore anyways. The current version worked for me.
UnremovableBeanBuildItem ensureJsonParserAvailable() { return UnremovableBeanBuildItem.beanTypes(ObjectMapper.class, Jsonb.class); }
return UnremovableBeanBuildItem.beanTypes(ObjectMapper.class, Jsonb.class);
UnremovableBeanBuildItem ensureJsonParserAvailable() { return UnremovableBeanBuildItem.beanClassNames( "io.quarkus.jackson.ObjectMapperProducer", "com.fasterxml.jackson.databind.ObjectMapper", "io.quarkus.jsonb.JsonbProducer", "javax.json.bind.Json...
class KafkaProcessor { static final Class[] BUILT_INS = { ShortSerializer.class, DoubleSerializer.class, LongSerializer.class, BytesSerializer.class, ByteArraySerializer.class, IntegerSerializer.class, ByteBufferSerial...
class KafkaProcessor { static final Class[] BUILT_INS = { ShortSerializer.class, DoubleSerializer.class, LongSerializer.class, BytesSerializer.class, ByteArraySerializer.class, IntegerSerializer.class, ByteBufferSerial...
Yes, these `checkState`s should be in `finally`. Thanks!
public void testBufferRecycledOnFailure() throws IOException { FailingChannelStateSerializer serializer = new FailingChannelStateSerializer(); TestRecoveredChannelStateHandler handler = new TestRecoveredChannelStateHandler(); try (FSDataInputStream stream = geStream(serializer, 10)) { new ChannelStateChunkRea...
checkState(serializer.failed);
public void testBufferRecycledOnFailure() throws IOException, InterruptedException { FailingChannelStateSerializer serializer = new FailingChannelStateSerializer(); TestRecoveredChannelStateHandler handler = new TestRecoveredChannelStateHandler(); try (FSDataInputStream stream = getStream(serializer, 10)) { n...
class ChannelStateChunkReaderTest { @Test(expected = TestException.class) @Test public void testBuffersNotRequestedForEmptyStream() throws IOException { ChannelStateSerializer serializer = new ChannelStateSerializerImpl(); TestRecoveredChannelStateHandler handler = new TestRecoveredChannelStateHandler(); ...
class ChannelStateChunkReaderTest { @Test(expected = TestException.class) @Test public void testBuffersNotRequestedForEmptyStream() throws IOException, InterruptedException { ChannelStateSerializer serializer = new ChannelStateSerializerImpl(); TestRecoveredChannelStateHandler handler = new TestRecoveredChan...
I don't think you can actually get here. The parser rejects non-SQL UDFs that don't specify a return type. I changed it to IllegalArgumentException.
void validateJavaUdf(ResolvedNodes.ResolvedCreateFunctionStmt createFunctionStmt) { for (FunctionArgumentType argumentType : createFunctionStmt.getSignature().getFunctionArgumentList()) { Type type = argumentType.getType(); if (type == null) { throw new UnsupportedOperationException("UDF...
throw new NullPointerException("UDF return type must not be null.");
void validateJavaUdf(ResolvedNodes.ResolvedCreateFunctionStmt createFunctionStmt) { for (FunctionArgumentType argumentType : createFunctionStmt.getSignature().getFunctionArgumentList()) { Type type = argumentType.getType(); if (type == null) { throw new UnsupportedOperationException("UDF...
class BeamZetaSqlCatalog { public static final String PRE_DEFINED_WINDOW_FUNCTIONS = "pre_defined_window_functions"; public static final String USER_DEFINED_SQL_FUNCTIONS = "user_defined_functions"; public static final String USER_DEFINED_JAVA_SCALAR_FUNCTIONS = "user_defined_java_scalar_functions"; ...
class BeamZetaSqlCatalog { public static final String PRE_DEFINED_WINDOW_FUNCTIONS = "pre_defined_window_functions"; public static final String USER_DEFINED_SQL_FUNCTIONS = "user_defined_functions"; public static final String USER_DEFINED_JAVA_SCALAR_FUNCTIONS = "user_defined_java_scalar_functions"; ...
To further improve this test: We can remove the timeout related logic here. The test already has a timeout set above.
public void testTimerExecution() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); options.setRunner(CrashingRunner.class); options.as(FlinkPipelineOptions.class).setFlinkMaster("[local]"); options.as(FlinkPipelineOptions.class).setStreaming(isStreaming); options ...
while (jobInvocation.getState() != Enum.DONE && System.currentTimeMillis() < timeout) {
public void testTimerExecution() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); options.setRunner(CrashingRunner.class); options.as(FlinkPipelineOptions.class).setFlinkMaster("[local]"); options.as(FlinkPipelineOptions.class).setStreaming(isStreaming); options ...
class PortableTimersExecutionTest implements Serializable { @Parameters public static Object[] testModes() { return new Object[] {true, false}; } @Parameter public boolean isStreaming; private transient ListeningExecutorService flinkJobExecutor; @Before public void setup() { flinkJobExecutor =...
class PortableTimersExecutionTest implements Serializable { @Parameters public static Object[] testModes() { return new Object[] {true, false}; } @Parameter public boolean isStreaming; private transient ListeningExecutorService flinkJobExecutor; @Before public void setup() { flinkJobExecutor =...
What I'm a bit concerned about here is that it is quite easy now for users to break things, for example, OIDC `AuthenticationFailedException`, if thrown by `quarkus-oidc` is better be handled by `quarkus-oidc` to prepare a correct challenge, and if the user has registered a mapper then this mapper is in total control ...
public Handler<RoutingContext> authenticationMechanismHandler(boolean proactiveAuthentication) { return new Handler<RoutingContext>() { volatile HttpAuthenticator authenticator; @Override public void handle(RoutingContext event) { if (authenticator == null) ...
public Handler<RoutingContext> authenticationMechanismHandler(boolean proactiveAuthentication) { return new Handler<RoutingContext>() { volatile HttpAuthenticator authenticator; @Override public void handle(RoutingContext event) { if (authenticator == null) ...
class HttpSecurityRecorder { private static final Logger log = Logger.getLogger(HttpSecurityRecorder.class); protected static final Consumer<Throwable> NOOP_CALLBACK = new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { } }; final RuntimeValue<HttpC...
class HttpSecurityRecorder { private static final Logger log = Logger.getLogger(HttpSecurityRecorder.class); protected static final Consumer<Throwable> NOOP_CALLBACK = new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { } }; final RuntimeValue<HttpC...
`null instanceof X` is always false so checking for null is redundant.
public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof WeightedValue)) { return false; } WeightedValue<?> that = (WeightedValue<?>) o; return weight == that.weight && Objects.equals(value, that.value); }
if (!(o instanceof WeightedValue)) {
public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof WeightedValue)) { return false; } WeightedValue<?> that = (WeightedValue<?>) o; return weight == that.weight && Objects.equals(value, that.value); }
class WeightedValue<T> implements Weighted { private final T value; private final long weight; private WeightedValue(T value, long weight) { this.value = value; this.weight = weight; } public static <T> WeightedValue<T> of(T value, long weight) { return new WeightedValue<>(value, weight); } ...
class WeightedValue<T> implements Weighted { private final T value; private final long weight; private WeightedValue(T value, long weight) { this.value = value; this.weight = weight; } public static <T> WeightedValue<T> of(T value, long weight) { return new WeightedValue<>(value, weight); } ...
move this after `configByConfiguration.addConfiguration(configuration);`
public void testGetInvalidLocalTimeZone() { expectedException.expectMessage( "The supported Zone ID is either an abbreviation such as 'PST'," + " a full name such as 'America/Los_Angeles', or a custom timezone id such as 'GMT-8:00'," + " but config...
"The supported Zone ID is either an abbreviation such as 'PST',"
public void testGetInvalidLocalTimeZone() { configuration.setString("table.local-time-zone", "UTC+8"); configByConfiguration.addConfiguration(configuration); expectedException.expectMessage( "The supported Zone ID is either a full name such as 'America/Los_Angeles'," ...
class TableConfigTest { @Rule public ExpectedException expectedException = ExpectedException.none(); private static TableConfig configByMethod = new TableConfig(); private static TableConfig configByConfiguration = new TableConfig(); private static Configuration configuration = new Configuration(); ...
class TableConfigTest { @Rule public ExpectedException expectedException = ExpectedException.none(); private static TableConfig configByMethod = new TableConfig(); private static TableConfig configByConfiguration = new TableConfig(); private static Configuration configuration = new Configuration(); ...
@rasika You are correct. I missed the `projectRoot.resolve()` part you have used. No issue with this then.
public static List<CodeAction> getAvailableCodeActions(CodeActionContext ctx) { LSClientLogger clientLogger = LSClientLogger.getInstance(ctx.languageServercontext()); List<CodeAction> codeActions = new ArrayList<>(); CodeActionProvidersHolder codeActionProvidersHolder = CodeActio...
CommonUtil.isWithinRange(ctx.cursorPosition(), CommonUtil.toRange(diag.location().lineRange()))
public static List<CodeAction> getAvailableCodeActions(CodeActionContext ctx) { LSClientLogger clientLogger = LSClientLogger.getInstance(ctx.languageServercontext()); List<CodeAction> codeActions = new ArrayList<>(); CodeActionProvidersHolder codeActionProvidersHolder = CodeActio...
class CodeActionRouter { /** * Returns a list of supported code actions. * * @param ctx {@link CodeActionContext} * @return list of code actions */ }
class CodeActionRouter { /** * Returns a list of supported code actions. * * @param ctx {@link CodeActionContext} * @return list of code actions */ }
Yes, by platform I meant JRE + OS + hardware (and when I briefly checked open-j9 this method was native and linux had suitable syscalls). But anyways I've already changed the code to 1ms.
private void buildGraph(StreamExecutionEnvironment env) { env.fromSource( new NumberSequenceSource(0, Long.MAX_VALUE), WatermarkStrategy.noWatermarks(), "num-source") .keyBy(value -> value)...
Thread.sleep(0, 100);
private void buildGraph(StreamExecutionEnvironment env) { env.fromSource( new NumberSequenceSource(0, Long.MAX_VALUE), WatermarkStrategy.noWatermarks(), "num-source") .keyBy(value -> value)...
class UnalignedCheckpointFailureHandlingITCase { private static final int PARALLELISM = 2; @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule public final SharedObjects sharedObjects = SharedObjects.create(); @Rule public final MiniClusterWithClientResource miniClu...
class UnalignedCheckpointFailureHandlingITCase { private static final int PARALLELISM = 2; @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule public final SharedObjects sharedObjects = SharedObjects.create(); @Rule public final MiniClusterWithClientResource miniClu...
Can you add sql parser test case for this change?
public ASTNode visitTableStatement(final TableStatementContext ctx) { MySQLSelectStatement result = new MySQLSelectStatement(); if (null != ctx.TABLE()) { result.setFrom(new SimpleTableSegment(new TableNameSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), new Id...
if (null != ctx.TABLE()) {
public ASTNode visitTableStatement(final TableStatementContext ctx) { MySQLSelectStatement result = new MySQLSelectStatement(); if (null != ctx.TABLE()) { result.setFrom(new SimpleTableSegment(new TableNameSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), new Id...
class MySQLStatementVisitor extends MySQLStatementBaseVisitor<ASTNode> { private final Collection<ParameterMarkerSegment> parameterMarkerSegments = new LinkedList<>(); @Override public final ASTNode visitParameterMarker(final ParameterMarkerContext ctx) { return new ParameterMarkerValue(pa...
class MySQLStatementVisitor extends MySQLStatementBaseVisitor<ASTNode> { private final Collection<ParameterMarkerSegment> parameterMarkerSegments = new LinkedList<>(); @Override public final ASTNode visitParameterMarker(final ParameterMarkerContext ctx) { return new ParameterMarkerValue(pa...
Could we avoid 1 `& allSelectedMask` here? It feels like it should only be relevant for `ALL`. We could then eagerly apply `allSelectedMask` instead of setting ALL (`new InputSelection(-1 & allSelectedMask)`).
boolean shouldSetAvailableForAnotherInput() { return (inputSelection.getInputMask() & allSelectedMask & ~availableInputsMask) != 0; }
return (inputSelection.getInputMask() & allSelectedMask & ~availableInputsMask) != 0;
boolean shouldSetAvailableForAnotherInput() { return (inputSelection.getInputMask() & allSelectedMask & ~availableInputsMask) != 0; }
class MultipleInputSelectionHandler { public static final int MAX_SUPPORTED_INPUT_COUNT = Long.SIZE; @Nullable private final InputSelectable inputSelector; private InputSelection inputSelection = InputSelection.ALL; private final long allSelectedMask; private long availableInputsMask; private long notFinish...
class MultipleInputSelectionHandler { public static final int MAX_SUPPORTED_INPUT_COUNT = Long.SIZE; @Nullable private final InputSelectable inputSelectable; private InputSelection inputSelection = InputSelection.ALL; private final long allSelectedMask; private long availableInputsMask; private long notFini...
@shehan360 , Could you check this code block ?
private static Path getAbsoluteModulePath(String sourceRoot, Path modulePath) { Path sourcePath = Paths.get(sourceRoot); if (sourcePath.endsWith(modulePath)) { return Paths.get(sourceRoot); } return sourcePath.resolve(ProjectDirConstants.MODULES_ROOT).resolve(modulePath); ...
return sourcePath.resolve(ProjectDirConstants.MODULES_ROOT).resolve(modulePath);
private static Path getAbsoluteModulePath(String sourceRoot, Path modulePath) { Path sourcePath = Paths.get(sourceRoot); if (sourcePath.endsWith(modulePath)) { return Paths.get(sourceRoot); } return sourcePath.resolve(ProjectDirConstants.MODULES_ROOT).resolve(modulePath); ...
class BallerinaDocGenerator { private static final Logger log = LoggerFactory.getLogger(BallerinaDocGenerator.class); private static PrintStream out = System.out; private static final String MODULE_CONTENT_FILE = "Module.md"; private static final Path BAL_BUILTIN = Paths.get("ballerina", "builtin"); ...
class BallerinaDocGenerator { private static final Logger log = LoggerFactory.getLogger(BallerinaDocGenerator.class); private static PrintStream out = System.out; private static final String MODULE_CONTENT_FILE = "Module.md"; private static final Path BAL_BUILTIN = Paths.get("ballerina", "builtin"); ...
I'm kinda sure that `volatile` doesn't matter here as `VarHandle`'s `getAcquire` + `setRelease` are used.
public T get() { T current = currentClient(); if (current == null) { synchronized (this) { current = currentClient(); if (current == null) { MongoClients mongoClients = Arc.container().instance(MongoClients.class).ge...
CLIENT.setRelease(this, current);
public T get() { MongoClients mongoClients = Arc.container().instance(MongoClients.class).get(); return producer.apply(mongoClients); }
class MongoClientSupplier<T> implements Supplier<T> { private static final VarHandle CLIENT; static { try { MethodHandles.Lookup lookup = MethodHandles.lookup(); CLIENT = lookup.findVarHandle(MongoClientSupplier.class, "client", Object.class); } c...
class MongoClientSupplier<T> implements Supplier<T> { private final Function<MongoClients, T> producer; MongoClientSupplier(Function<MongoClients, T> producer) { this.producer = producer; } @Override }
Please rewrite the error message too
public Savepoint setSavepoint(final String savepointName) throws SQLException { if (!connectionTransaction.isInTransaction()) { throw new SQLException("Now, not in transaction"); } ShardingSphereSavepoint result = new ShardingSphereSavepoint(savepointName); for (Connection ea...
throw new SQLException("Now, not in transaction");
public Savepoint setSavepoint(final String savepointName) throws SQLException { if (!connectionTransaction.isInTransaction()) { throw new SQLException("Savepoint can only be used in transaction blocks."); } ShardingSphereSavepoint result = new ShardingSphereSavepoint(savepointName); ...
class ConnectionManager implements ExecutorJDBCConnectionManager, AutoCloseable { private final Map<String, DataSource> dataSourceMap = new LinkedHashMap<>(); private final Map<String, DataSource> physicalDataSourceMap = new LinkedHashMap<>(); @Getter private final ConnectionTransaction c...
class ConnectionManager implements ExecutorJDBCConnectionManager, AutoCloseable { private final Map<String, DataSource> dataSourceMap = new LinkedHashMap<>(); private final Map<String, DataSource> physicalDataSourceMap = new LinkedHashMap<>(); @Getter private final ConnectionTransaction c...