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
For completeness, why don't you pass here `stateHandle.getStateSize()`?
public IncrementalLocalKeyedStateHandle createLocalStateHandleForDownloadedState() { return new IncrementalLocalKeyedStateHandle( stateHandle.getBackendIdentifier(), stateHandle.getCheckpointId(), new DirectoryStateHandle(download...
new DirectoryStateHandle(downloadDestination, 0L),
public IncrementalLocalKeyedStateHandle createLocalStateHandleForDownloadedState() { return new IncrementalLocalKeyedStateHandle( stateHandle.getBackendIdentifier(), stateHandle.getCheckpointId(), new DirectoryStateHandle(downloadDestination, stateHandle.getStateS...
class StateHandleDownloadSpec { /** The state handle to download. */ private final IncrementalRemoteKeyedStateHandle stateHandle; /** The path to which the content of the state handle shall be downloaded. */ private final Path downloadDestination; public StateHandleDownloadSpec( Increm...
class StateHandleDownloadSpec { /** The state handle to download. */ private final IncrementalRemoteKeyedStateHandle stateHandle; /** The path to which the content of the state handle shall be downloaded. */ private final Path downloadDestination; public StateHandleDownloadSpec( Increm...
Unfortunately, doing so would cause an NPE in the docker environment factory. The server's address descriptor is explicitly used there in order to pass to the docker invocation. I'll introduce a no-op or exception-throwing artifact retrieval service for now to make this explicit.
public static DockerJobBundleFactory create(ArtifactSource artifactSource) throws Exception { DockerCommand dockerCommand = DockerCommand.forExecutable("docker", Duration.ofSeconds(60)); ServerFactory serverFactory = getServerFactory(); IdGenerator stageIdGenerator = IdGenerators.incrementingLongs(); Co...
public static DockerJobBundleFactory create(ArtifactSource artifactSource) throws Exception { ServerFactory serverFactory = getServerFactory(); IdGenerator stageIdGenerator = IdGenerators.incrementingLongs(); ControlClientPool clientPool = MapControlClientPool.create(); GrpcFnServer<FnApiControlClientP...
class DockerJobBundleFactory implements JobBundleFactory { private static final Logger LOG = LoggerFactory.getLogger(DockerJobBundleFactory.class); private static final String DOCKER_FOR_MAC_HOST = "host.docker.internal"; private final IdGenerator stageIdGenerator; private final GrpcFnServer<FnApiContro...
class DockerJobBundleFactory implements JobBundleFactory { private static final Logger LOG = LoggerFactory.getLogger(DockerJobBundleFactory.class); private static final String DOCKER_FOR_MAC_HOST = "host.docker.internal"; private final IdGenerator stageIdGenerator; private final GrpcFnServer<FnApiContro...
When users need to disable checkpoint during backlog, they can configure checkpoint-interval-during-backlog into -1L. In checkpoint-interval's case, user can disable checkpoint by not setting this configuration. However, according to FLIP-309, not setting checkpoint-interval-during-backlog stands for using the same va...
public void setCheckpointIntervalDuringBacklog(long checkpointInterval) { if (checkpointInterval != -1L && checkpointInterval < MINIMAL_CHECKPOINT_TIME) { throw new IllegalArgumentException( String.format( "Checkpoint interval must be larger than or eq...
if (checkpointInterval != -1L && checkpointInterval < MINIMAL_CHECKPOINT_TIME) {
public void setCheckpointIntervalDuringBacklog(long checkpointInterval) { if (checkpointInterval != 0 && checkpointInterval < MINIMAL_CHECKPOINT_TIME) { throw new IllegalArgumentException( String.format( "Checkpoint interval must be zero or larger than...
class CheckpointConfig implements java.io.Serializable { private static final long serialVersionUID = -750378776078908147L; private static final Logger LOG = LoggerFactory.getLogger(CheckpointConfig.class); @Deprecated /** * The default checkpoint mode: e...
class CheckpointConfig implements java.io.Serializable { private static final long serialVersionUID = -750378776078908147L; private static final Logger LOG = LoggerFactory.getLogger(CheckpointConfig.class); @Deprecated /** * The default checkpoint mode: e...
I can confirm what @gsmet mentions from my part as well. We have instructed contributors multiple times to avoid them. Of course some can sneak in 😁
private void dispatch(RoutingContext routingContext, InputStream is, VertxOutput output) { try { Context ctx = vertx.getOrCreateContext(); HttpServerRequest request = routingContext.request(); ResteasyUriInfo uriInfo = VertxUtil.extractUriInfo(request, rootPath); ...
Supplier<String> hostNameProvider = () -> {
private void dispatch(RoutingContext routingContext, InputStream is, VertxOutput output) { try { Context ctx = vertx.getOrCreateContext(); HttpServerRequest request = routingContext.request(); ResteasyUriInfo uriInfo = VertxUtil.extractUriInfo(request, rootPath); ...
class VertxRequestHandler implements Handler<RoutingContext> { private static final Logger log = Logger.getLogger("io.quarkus.resteasy"); protected final Vertx vertx; protected final RequestDispatcher dispatcher; protected final String rootPath; protected final BufferAllocator allocator; protec...
class VertxRequestHandler implements Handler<RoutingContext> { private static final Logger log = Logger.getLogger("io.quarkus.resteasy"); protected final Vertx vertx; protected final RequestDispatcher dispatcher; protected final String rootPath; protected final BufferAllocator allocator; protec...
Our Uid format is internal and if we change the format then this will break (similarly if Quarkus replaces the underlying transaction engine). Testing uid format does not provide any positive benefit? However the test that verifies that the `@Transactional` annotation correctly starts a transaction is valid and is suf...
public void test() { RestAssured.when().get("/uid").then().assertThat().body(MatchesPattern.matchesPattern("[:0-9a-f]+")); RestAssured.when().get("/status").then().body(is("0")); }
RestAssured.when().get("/uid").then().assertThat().body(MatchesPattern.matchesPattern("[:0-9a-f]+"));
public void test() { RestAssured.when().get("/status").then().body(is("0")); }
class TransactionalTestCase { @Test }
class TransactionalTestCase { @Test }
do we need add this operationtype to doris-2.0 branch?
public void readFields(DataInput in) throws IOException { opCode = in.readShort(); boolean isRead = false; LOG.debug("get opcode: {}", opCode); switch (opCode) { case OperationType.OP_LOCAL_EOF: { data = null; isRead = true; ...
case OperationType.OP_DELETE_TABLE_STATS: {
public void readFields(DataInput in) throws IOException { opCode = in.readShort(); boolean isRead = false; LOG.debug("get opcode: {}", opCode); switch (opCode) { case OperationType.OP_LOCAL_EOF: { data = null; isRead = true; ...
class JournalEntity implements Writable { public static final Logger LOG = LogManager.getLogger(JournalEntity.class); private short opCode; private Writable data; private long dataSize; public short getOpCode() { return this.opCode; } public void setOpCode(short opCode) { ...
class JournalEntity implements Writable { public static final Logger LOG = LogManager.getLogger(JournalEntity.class); private short opCode; private Writable data; private long dataSize; public short getOpCode() { return this.opCode; } public void setOpCode(short opCode) { ...
`finishBundle` contains a different blocking version of flush that only blocks on the records emitted by this bundle. It would actually be harmful to do that: Using `producer.flushSync()` in `finishBundle` would likely block that dofn instance "forever" because the producer is shared and other instances keep writing to...
private void teardownSharedProducer() { synchronized (producerRefCount) { if (producerRefCount.decrementAndGet() == 0) { if (producer == null) { return; } if (producer.getOutstandingRecordsCount() > 0) { producer.flushSync();...
producer.flushSync();
private void teardownSharedProducer() { IKinesisProducer obsolete = null; synchronized (KinesisWriterFn.class) { if (--producerRefCount == 0) { obsolete = producer; producer = null; } } if (obsolete != null) { obsolete.flushSync(); ...
class KinesisWriterFn extends DoFn<byte[], Void> { private static final int MAX_NUM_FAILURES = 10; /** Usage count of static, shared Kinesis producer. */ private static final AtomicInteger producerRefCount = new AtomicInteger(); /** Static, shared Kinesis producer. */ private static IKine...
class KinesisWriterFn extends DoFn<byte[], Void> { private static final int MAX_NUM_FAILURES = 10; /** Usage count of static, shared Kinesis producer. */ private static int producerRefCount = 0; /** Static, shared Kinesis producer. */ private static IKinesisProducer producer; priv...
The motivation is for setting the default timeout (100) only for streaming job by design. But in this procedure we can not determine the `ResultPartitionType` for properly setting the default value, so I removed that path before. And actually the default value can also be set/got in the following procedure by `StreamCo...
private Collection<Integer> transform(Transformation<?> transform) { if (alreadyTransformed.containsKey(transform)) { return alreadyTransformed.get(transform); } LOG.debug("Transforming " + transform); if (transform.getMaxParallelism() <= 0) { int globalMaxParallelismFromConfig = executionConf...
streamGraph.setTransformationUID(transform.getId(), transform.getUid());
private Collection<Integer> transform(Transformation<?> transform) { if (alreadyTransformed.containsKey(transform)) { return alreadyTransformed.get(transform); } LOG.debug("Transforming " + transform); if (transform.getMaxParallelism() <= 0) { int globalMaxParallelismFromConfig = executionConf...
class StreamGraphGenerator { private static final Logger LOG = LoggerFactory.getLogger(StreamGraphGenerator.class); public static final int DEFAULT_LOWER_BOUND_MAX_PARALLELISM = KeyGroupRangeAssignment.DEFAULT_LOWER_BOUND_MAX_PARALLELISM; public static final ScheduleMode DEFAULT_SCHEDULE_MODE = ScheduleMode.EAGER...
class StreamGraphGenerator { private static final Logger LOG = LoggerFactory.getLogger(StreamGraphGenerator.class); public static final int DEFAULT_LOWER_BOUND_MAX_PARALLELISM = KeyGroupRangeAssignment.DEFAULT_LOWER_BOUND_MAX_PARALLELISM; public static final ScheduleMode DEFAULT_SCHEDULE_MODE = ScheduleMode.EAGER...
Please rename variable name `utils` because of there is no any relationship with variable name and class type.
public UpdateStatementContext(final UpdateStatement sqlStatement) { super(sqlStatement); TableExtractor utils = new TableExtractor(); utils.extractTablesFromUpdate(sqlStatement); tablesContext = new TablesContext(utils.getRewriteTables()); }
TableExtractor utils = new TableExtractor();
public UpdateStatementContext(final UpdateStatement sqlStatement) { super(sqlStatement); TableExtractor tableExtractor = new TableExtractor(); tableExtractor.extractTablesFromUpdate(sqlStatement); tablesContext = new TablesContext(tableExtractor.getRewriteTables()); }
class UpdateStatementContext extends CommonSQLStatementContext<UpdateStatement> implements TableAvailable, WhereAvailable { private final TablesContext tablesContext; @Override public Collection<SimpleTableSegment> getAllTables() { TableExtractor tableExtractor = new TableExtract...
class UpdateStatementContext extends CommonSQLStatementContext<UpdateStatement> implements TableAvailable, WhereAvailable { private final TablesContext tablesContext; @Override public Collection<SimpleTableSegment> getAllTables() { TableExtractor tableExtractor = new TableExtract...
We don't really have something, but it would likely make sense to add it
Object aroundInvoke(InvocationContext ctx) throws Exception { if (ctx.getMethod().getReturnType().equals(Uni.class)) { return invokeUni(ctx); } return invoke(ctx); }
if (ctx.getMethod().getReturnType().equals(Uni.class)) {
Object aroundInvoke(InvocationContext ctx) throws Exception { switch (ReactiveType.valueOf(ctx.getMethod())) { case UNI: return invokeUni(ctx); case MULTI: return invokeMulti(ctx); case STAGE: return invokeStage(ctx); ...
class ActivateRequestContextInterceptor { @AroundInvoke private Uni<?> invokeUni(InvocationContext ctx) { return Uni.createFrom().item(Arc.container()::requestContext) .chain(requestContext -> { if (requestContext.isActive()) { return pr...
class ActivateRequestContextInterceptor { @AroundInvoke private CompletionStage<?> invokeStage(InvocationContext ctx) { ManagedContext requestContext = Arc.container().requestContext(); if (requestContext.isActive()) { return proceedWithStage(ctx); } return ac...
Only these test jobs will be triggered automatically. Undeclared jobs may still be triggered by users, though, but that likely won't happen if they aren't shown here :)
public List<StepStatus> allSteps() { List<JobId> firstTestJobs = List.of(firstDeclaredOrElseImplicitTest(systemTest), firstDeclaredOrElseImplicitTest(stagingTest)); return allSteps.stream() .filter(step -> step.isDeclared() || firstTestJ...
List<JobId> firstTestJobs = List.of(firstDeclaredOrElseImplicitTest(systemTest),
public List<StepStatus> allSteps() { List<JobId> firstTestJobs = List.of(firstDeclaredOrElseImplicitTest(systemTest), firstDeclaredOrElseImplicitTest(stagingTest)); return allSteps.stream() .filter(step -> step.isDeclared() || firstTestJ...
class DeploymentStatus { public static List<JobId> jobsFor(Application application, SystemName system) { if (DeploymentSpec.empty.equals(application.deploymentSpec())) return List.of(); return application.deploymentSpec().instances().stream() .flatMap(spec -> ...
class DeploymentStatus { public static List<JobId> jobsFor(Application application, SystemName system) { if (DeploymentSpec.empty.equals(application.deploymentSpec())) return List.of(); return application.deploymentSpec().instances().stream() .flatMap(spec -> ...
IMHO, if the exist check is expensive, we shouldn't do it and rather rely on the implementation but add a comment in the `FlinkKubeClient.deleteConfigMapsBy*` implementations. Doing the exist call would just be more coherent with the actual contract of the interface provided by the fabric8 client.
public CompletableFuture<Void> deleteConfigMapsByLabels(Map<String, String> labels) { return CompletableFuture.runAsync( () -> { if (!this.internalClient.configMaps().withLabels(labels).delete()) { final List<ConfigMap> notDeletedConfigMaps = ...
if (!this.internalClient.configMaps().withLabels(labels).delete()) {
public CompletableFuture<Void> deleteConfigMapsByLabels(Map<String, String> labels) { return CompletableFuture.runAsync( () -> this.internalClient.configMaps().withLabels(labels).delete(), kubeClientExecutorService); }
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...
our code style unfortunately does not cover the placement of such braces; hence we reject any changes such as this to existing code.
private static List<ReporterSetup> setupReporters(Map<String, MetricReporterFactory> reporterFactories, List<Tuple2<String, Configuration>> reporterConfigurations) { List<ReporterSetup> reporterSetups = new ArrayList<>(reporterConfigurations.size()); for (Tuple2<String, Configuration> reporterConfiguration: reporte...
reporterConfig.addAllToProperties(metricConfig);
private static List<ReporterSetup> setupReporters(Map<String, MetricReporterFactory> reporterFactories, List<Tuple2<String, Configuration>> reporterConfigurations) { List<ReporterSetup> reporterSetups = new ArrayList<>(reporterConfigurations.size()); for (Tuple2<String, Configuration> reporterConfiguration: reporte...
class ReporterSetup { private static final Logger LOG = LoggerFactory.getLogger(ReporterSetup.class); private static final Pattern reporterListPattern = Pattern.compile("\\s*,\\s*"); private static final Pattern reporterClassPattern = Pattern.compile( Pattern.quote(ConfigConstants.METRICS_REPORTER_PREFIX) +...
class configuration detected for reporter {}
Not totally understanding this, would you please kindly talk about it more clearly?
public void testIODirectoryNotWritable() throws Exception { File nonWritable = tempFolder.newFolder(); Assume.assumeTrue("Cannot create non-writable temporary file directory. Skipping test.", nonWritable.setWritable(false, false)); try { Configuration cfg = new Configuration(); cfg.setString(CoreOptions...
mock(FatalErrorHandler.class));
public void testIODirectoryNotWritable() throws Exception { File nonWritable = tempFolder.newFolder(); Assume.assumeTrue("Cannot create non-writable temporary file directory. Skipping test.", nonWritable.setWritable(false, false)); try { Configuration cfg = new Configuration(); cfg.setString(CoreOptions...
class TaskManagerRunnerStartupTest extends TestLogger { private static final String LOCAL_HOST = "localhost"; @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); private RpcService rpcService = createRpcService(); /** * Tests that the TaskManagerRunner startup fails synchronously when the I/O ...
class TaskManagerRunnerStartupTest extends TestLogger { private static final String LOCAL_HOST = "localhost"; @Rule public final TemporaryFolder tempFolder = new TemporaryFolder(); private final RpcService rpcService = createRpcService(); private TestingHighAvailabilityServices highAvailabilityServices; @Bef...
`@DoNotRecord(skipInPlayback = true)` -> there is this case in resources. I will delete this part logic and try on playback and record mode.
protected void beforeTest() { TokenCredential credential; HttpPipeline httpPipeline; Map<String, String> textReplacementRules = new HashMap<>(); String logLevel = Configuration.getGlobalConfiguration().get(AZURE_TEST_LOG_LEVEL); HttpLogDetailLevel httpLogDetailLevel; try...
protected void beforeTest() { TokenCredential credential; HttpPipeline httpPipeline; String logLevel = Configuration.getGlobalConfiguration().get(AZURE_TEST_LOG_LEVEL); HttpLogDetailLevel httpLogDetailLevel; try { httpLogDetailLevel = HttpLogDetailLevel.valueOf(logLe...
class ResourceManagerTestProxyTestBase extends TestProxyTestBase { private static final String ZERO_UUID = "00000000-0000-0000-0000-000000000000"; private static final String ZERO_SUBSCRIPTION = ZERO_UUID; private static final String ZERO_TENANT = ZERO_UUID; private static final String PLAYBACK_URI_BASE...
class ResourceManagerTestProxyTestBase extends TestProxyTestBase { private static final String ZERO_UUID = "00000000-0000-0000-0000-000000000000"; private static final String ZERO_SUBSCRIPTION = ZERO_UUID; private static final String ZERO_TENANT = ZERO_UUID; private static final String PLAYBACK_URI_BASE...
Do we need this codepath at all - can we just always use path from line 163? It also looks like this method is called quite often, so it'd be good to avoid a FileSystems.match() call every time it's called.
private ResourceId getJobDirResourceId(String stagingSessionToken) throws IOException { ResourceId baseResourceId; StagingSessionToken parsedToken = decodeStagingSessionToken(stagingSessionToken); try { baseResourceId = FileSystems.matchSingleFileSpec(parsedToken.getBasePath()) .resourceId()...
baseResourceId = FileSystems.matchSingleFileSpec(parsedToken.getBasePath())
private ResourceId getJobDirResourceId(String stagingSessionToken) throws Exception { ResourceId baseResourceId; StagingSessionToken parsedToken = decodeStagingSessionToken(stagingSessionToken); baseResourceId = FileSystems .matchNewResource(parsedToken.getBasePath(), true /* isDirectory */); ...
class BeamFileSystemArtifactStagingService extends ArtifactStagingServiceImplBase implements FnService { private static final Logger LOG = LoggerFactory.getLogger(BeamFileSystemArtifactStagingService.class); private static final ObjectMapper MAPPER = new ObjectMapper(); private static final Charset ...
class BeamFileSystemArtifactStagingService extends ArtifactStagingServiceImplBase implements FnService { private static final Logger LOG = LoggerFactory.getLogger(BeamFileSystemArtifactStagingService.class); private static final ObjectMapper MAPPER = new ObjectMapper(); private static final Charset ...
Nit: spelling/grammar ```suggestion // to Calc nodes before merging with other Project/Filter/Calc nodes. Thus we should not add ```
private static RuleSet[] modifyRuleSetsForZetaSql(RuleSet[] ruleSets) { RuleSet[] ret = new RuleSet[ruleSets.length]; for (int i = 0; i < ruleSets.length; i++) { ImmutableList.Builder<RelOptRule> bd = ImmutableList.builder(); for (RelOptRule rule : ruleSets[i]) { if (rule i...
private static RuleSet[] modifyRuleSetsForZetaSql(RuleSet[] ruleSets) { RuleSet[] ret = new RuleSet[ruleSets.length]; for (int i = 0; i < ruleSets.length; i++) { ImmutableList.Builder<RelOptRule> bd = ImmutableList.builder(); for (RelOptRule rule : ruleSets[i]) { if (rule i...
class ZetaSQLQueryPlanner implements QueryPlanner { private final ZetaSQLPlannerImpl plannerImpl; public ZetaSQLQueryPlanner(FrameworkConfig config) { plannerImpl = new ZetaSQLPlannerImpl(config); } /** * Called by {@link org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv}.instantiatePlanner() * ref...
class ZetaSQLQueryPlanner implements QueryPlanner { private final ZetaSQLPlannerImpl plannerImpl; public ZetaSQLQueryPlanner(FrameworkConfig config) { plannerImpl = new ZetaSQLPlannerImpl(config); } /** * Called by {@link org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv}.instantiatePlanner() * ref...
minor note: I think you meant to delete these 3 commented lines.
public void testFlattenWithDuplicateInputCollectionProducesMultipleOutputs() throws Exception { String pTransformId = "pTransformId"; String mainOutputId = "101"; RunnerApi.FunctionSpec functionSpec = RunnerApi.FunctionSpec.newBuilder() .setUrn(PTransformTranslation.FLATTEN_TRANSFORM_UR...
public void testFlattenWithDuplicateInputCollectionProducesMultipleOutputs() throws Exception { String pTransformId = "pTransformId"; String mainOutputId = "101"; RunnerApi.FunctionSpec functionSpec = RunnerApi.FunctionSpec.newBuilder() .setUrn(PTransformTranslation.FLATTEN_TRANSFORM_UR...
class FlattenRunnerTest { /** * Create a Flatten that has 4 inputs (inputATarget1, inputATarget2, inputBTarget, inputCTarget) * and one output (mainOutput). Validate that inputs are flattened together and directed to the * output. */ @Test public void testCreatingAndProcessingDoFlatten() throws Excep...
class FlattenRunnerTest { /** * Create a Flatten that has 4 inputs (inputATarget1, inputATarget2, inputBTarget, inputCTarget) * and one output (mainOutput). Validate that inputs are flattened together and directed to the * output. */ @Test public void testCreatingAndProcessingDoFlatten() throws Excep...
Something like this ````java @ProcessElement public void processElement(@Element T input, ProcessContext context) { try { publishMessage(input); } catch (JMSException | JmsIOException | IOException | InterruptedException exception) { LOG.error("Error while publishing the message", exception); context.o...
public void processElement(@Element T input, ProcessContext context) { try { publishMessage(input, context); } catch (IOException | InterruptedException exception) { LOG.error("Error while publishing the message", exception); context.output(this.failedMessagesTags, input); ...
LOG.error("Error while publishing the message", exception);
public void processElement(@Element T input, ProcessContext context) { try { publishMessage(input); } catch (JMSException | JmsIOException | IOException | InterruptedException exception) { LOG.error("Error while publishing the message", exception); context.output(this.faile...
class JmsIOProducerFn<T> extends DoFn<T, T> { private final @Initialized JmsConnection<T> jmsConnection; private final TupleTag<T> failedMessagesTag; JmsIOProducerFn(JmsIO.Write<T> spec, TupleTag<T> failedMessagesTag) { this.failedMessagesTag = failedMessagesTag; this.jmsConnection =...
class JmsIOProducerFn<T> extends DoFn<T, T> { private transient @Initialized FluentBackoff retryBackOff; private final JmsIO.Write<T> spec; private final TupleTag<T> failedMessagesTags; private final @Initialized JmsConnection<T> jmsConnection; private final Counter publicationRetries = ...
Java `HashMap` and SQL MAP allow null keys and null values. I will add a test for this in `testSerDeMultiRowsWithNullValues`.
private DeserializationRuntimeConverter createMapConverter(MapType mapType) { LogicalType keyType = mapType.getKeyType(); if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) { throw new UnsupportedOperationException( "JSON format doesn't support non-string as key type of map. " + ...
result.put(key, value);
private DeserializationRuntimeConverter createMapConverter(MapType mapType) { LogicalType keyType = mapType.getKeyType(); if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) { throw new UnsupportedOperationException( "JSON format doesn't support non-string as key type of map. " + ...
class Builder { private RowType rowType; private TypeInformation<RowData> resultTypeInfo; private boolean failOnMissingField = false; private boolean ignoreParseErrors = false; /** * Configures with the {@link RowType} schema information. */ public Builder schema(RowType rowType) { this.rowType =...
class JsonRowDataDeserializationSchema implements DeserializationSchema<RowData> { private static final long serialVersionUID = 1L; /** Flag indicating whether to fail if a field is missing. */ private final boolean failOnMissingField; /** Flag indicating whether to ignore invalid fields/rows (default: throw an e...
counter.get() is not correct here as counter is the number of default action executions, not the number of mails. At the moment, the number of mails processed includes only the poison mail and manual the stop mail. So it would be 2. However, if there are changes in future that some house-keeping mails are generated and...
public void testRunDefaultActionAndMails() throws Exception { AtomicBoolean stop = new AtomicBoolean(false); AtomicInteger counter = new AtomicInteger(); MailboxThread mailboxThread = new MailboxThread() { @Override public void runDefaultAc...
Assert.assertTrue(mailboxProcessor.getNumMailsProcessedCounter().getCount() > 0);
public void testRunDefaultActionAndMails() throws Exception { AtomicBoolean stop = new AtomicBoolean(false); AtomicInteger counter = new AtomicInteger(); MailboxThread mailboxThread = new MailboxThread() { @Override public void runDefaultAc...
class TaskMailboxProcessorTest { public static final int DEFAULT_PRIORITY = 0; @Rule public ExpectedException expectedException = ExpectedException.none(); @Test public void testRejectIfNotOpen() { MailboxProcessor mailboxProcessor = new MailboxProcessor(controller -> {}); mailboxProc...
class TaskMailboxProcessorTest { public static final int DEFAULT_PRIORITY = 0; @Rule public ExpectedException expectedException = ExpectedException.none(); @Test public void testRejectIfNotOpen() { MailboxProcessor mailboxProcessor = new MailboxProcessor(controller -> {}); mailboxProc...
`IntermediateDataSetID` has a param-less ctor I think.
public IntermediateResultPartitionID() { this.partitionNum = -1; this.intermediateDataSetID = new IntermediateDataSetID(new AbstractID()); }
this.intermediateDataSetID = new IntermediateDataSetID(new AbstractID());
public IntermediateResultPartitionID() { this.partitionNum = -1; this.intermediateDataSetID = new IntermediateDataSetID(); }
class IntermediateResultPartitionID implements ResultID { private static final long serialVersionUID = 1L; private final IntermediateDataSetID intermediateDataSetID; private final int partitionNum; /** * Creates an new random intermediate result partition ID for testing. */ @VisibleForTesting /** * Cr...
class IntermediateResultPartitionID implements ResultID { private static final long serialVersionUID = 1L; private final IntermediateDataSetID intermediateDataSetID; private final int partitionNum; /** * Creates an new random intermediate result partition ID for testing. */ @VisibleForTesting /** * Cr...
This check excludes the decimal value zero (whole set of decimal zero values with different precision) from the set of values covered by the check `bd.abs(MathContext.DECIMAL128).compareTo(MIN_DECIMAL_MAGNITUDE) < 0`.
private static BigDecimal getValidDecimalValue(BigDecimal bd) { if (bd.compareTo(DECIMAL_MAX) > 0 || bd.compareTo(DECIMAL_MIN) < 0) { throw ErrorCreator.createError(BallerinaErrorReasons.NUMBER_OVERFLOW, BLangExceptionHelper.getErrorDetails(RuntimeErrors.DECIMAL_VALUE_OUT_OF_RANG...
bd.abs(MathContext.DECIMAL128).compareTo(BigDecimal.ZERO) > 0) {
private static BigDecimal getValidDecimalValue(BigDecimal bd) { if (bd.compareTo(DECIMAL_MAX) > 0 || bd.compareTo(DECIMAL_MIN) < 0) { throw ErrorCreator.createError(BallerinaErrorReasons.NUMBER_OVERFLOW, BLangExceptionHelper.getErrorDetails(RuntimeErrors.DECIMAL_VALUE_OUT_OF_RANG...
class DecimalValue implements SimpleValue, BDecimal { private static final String INF_STRING = "Infinity"; private static final String NEG_INF_STRING = "-" + INF_STRING; private static final String NAN = "NaN"; private static final BigDecimal DECIMAL_MAX = new BigDecimal("9.9999999999999999...
class DecimalValue implements SimpleValue, BDecimal { private static final String INF_STRING = "Infinity"; private static final String NEG_INF_STRING = "-" + INF_STRING; private static final String NAN = "NaN"; private static final BigDecimal DECIMAL_MAX = new BigDecimal("9.9999999999999999...
You are right. Avoiding creating many instances of DataFormat is a big optimization.
private long convertTimestampToMillis(String timestamp) throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat.parse(timestamp).getTime(); }
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private long convertTimestampToMillis(String timestamp) throws ParseException { return dateFormat.parse(timestamp).getTime(); }
class BeamSqlLineIT implements Serializable { @Rule public transient TestPubsub eventsTopic = TestPubsub.create(); private static String project = TestPipeline.testingPipelineOptions().as(GcpOptions.class).getProject(); private static String createPubsubTableStatement; private static String setProject; ...
class BeamSqlLineIT implements Serializable { @Rule public transient TestPubsub eventsTopic = TestPubsub.create(); private static String project; private static String createPubsubTableStatement; private static String setProject; private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-...
This is required because we dont have access to the created `LeaderElection`? Shouldn't this use `TestingLeaderElectionService#triggerContenderCleanup`?
public static void teardownClass() throws Exception { haService.closeAndCleanupAllData(); if (rpcService != null) { RpcUtils.terminateRpcService(rpcService); } }
haService.closeAndCleanupAllData();
public static void teardownClass() throws Exception { if (rpcService != null) { RpcUtils.terminateRpcService(rpcService); } }
class ResourceManagerServiceImplTest extends TestLogger { private static final Time TIMEOUT = Time.seconds(10L); private static final Time FAST_TIMEOUT = Time.milliseconds(50L); private static final HeartbeatServices heartbeatServices = new TestingHeartbeatServices(); private static final DelegationTo...
class ResourceManagerServiceImplTest extends TestLogger { private static final HeartbeatServices heartbeatServices = new TestingHeartbeatServices(); private static final DelegationTokenManager delegationTokenManager = new NoOpDelegationTokenManager(); private static final ClusterInformation clu...
I guess the result is the same but I always favor Objects.equals then I don't have to think too much about NPE (even if in that case it's not the case :p)
DefaultCodestartFileStrategyHandler getSelectedDefaultStrategy() { for (CodestartFileStrategy codestartFileStrategy : strategies) { if (Objects.equals(codestartFileStrategy.getFilter(), "*")) { if (codestartFileStrategy.getHandler() instanceof DefaultCodestartFileStrategyHandler) { ...
if (Objects.equals(codestartFileStrategy.getFilter(), "*")) {
DefaultCodestartFileStrategyHandler getSelectedDefaultStrategy() { for (CodestartFileStrategy codestartFileStrategy : strategies) { if (Objects.equals(codestartFileStrategy.getFilter(), "*")) { if (codestartFileStrategy.getHandler() instanceof DefaultCodestartFileStrategyHandler) { ...
class CodestartProcessor { private final CodestartResourceLoader resourceLoader; private final String languageName; private final Path targetDirectory; private final List<CodestartFileStrategy> strategies; private final Map<String, Object> data; private final Map<String, List<CodestartFile>> fi...
class CodestartProcessor { private final CodestartResourceLoader resourceLoader; private final String languageName; private final Path targetDirectory; private final List<CodestartFileStrategy> strategies; private final Map<String, Object> data; private final Map<String, List<CodestartFile>> fi...
The write tests also read from bigquery table for validation with pipelines, with exactly same pipelines of the read test. So I have consolidated these two read tests into writeandread.
public void readAndValidateRows(BigQueryIOJsonOptions options) { TypedRead<TableRow> bigqueryIO = BigQueryIO.readTableRows().withMethod(options.getReadMethod()); if (!options.getInputQuery().isEmpty()) { bigqueryIO = bigqueryIO.fromQuery(options.getInputQuery()).usingStandardSql(); } else { ...
jsonRows.apply(
public void readAndValidateRows(BigQueryIOJsonOptions options) { TypedRead<TableRow> bigqueryIO = BigQueryIO.readTableRows().withMethod(options.getReadMethod()); if (!options.getInputQuery().isEmpty()) { bigqueryIO = bigqueryIO.fromQuery(options.getInputQuery()).usingStandardSql(); } else { ...
class CompareJsonStrings implements SerializableFunction<Iterable<KV<String, String>>, Void> { Map<String, String> expected; final boolean unescape; public CompareJsonStrings(Map<String, String> expected) { this(expected, false); } public CompareJsonString...
class CompareJsonStrings implements SerializableFunction<Iterable<KV<String, String>>, Void> { Map<String, String> expected; final boolean unescape; public CompareJsonStrings(Map<String, String> expected) { this(expected, false); } public CompareJsonString...
Shall we set `symTable.builtinPos` instead since in this case, name is a compiler-generated one?
public BLangNode transform(RequiredParameterNode requiredParameter) { BLangSimpleVariable simpleVar = createSimpleVar(requiredParameter.paramName(), requiredParameter.typeName(), requiredParameter.annotations()); simpleVar.pos = getPosition(require...
simpleVar.name.pos = simpleVar.pos;
public BLangNode transform(RequiredParameterNode requiredParameter) { BLangSimpleVariable simpleVar = createSimpleVar(requiredParameter.paramName(), requiredParameter.typeName(), requiredParameter.annotations()); simpleVar.pos = getPosition(require...
class definition */ @Override public BLangNode transform(ObjectConstructorExpressionNode objectConstructorExpressionNode) { Location pos = getPositionWithoutMetadata(objectConstructorExpressionNode); BLangClassDefinition anonClass = transformObjectCtorExpressionBody(objectConstructorExpress...
class definition */ @Override public BLangNode transform(ObjectConstructorExpressionNode objectConstructorExpressionNode) { Location pos = getPositionWithoutMetadata(objectConstructorExpressionNode); BLangClassDefinition anonClass = transformObjectCtorExpressionBody(objectConstructorExpress...
When retry the export task, does the queryId changed or not?
protected void exec() { LOG.info("begin execute sub task, task idx: {}, task query id: {}", taskIdx, getQueryId()); boolean success = false; String failMsg = null; for (int i = 0; i < RETRY_NUM; ++i) { if (job.isExportDone()) { ...
DebugUtil.printId(coord.getQueryId()));
protected void exec() { if (job.getState() != ExportJob.JobState.EXPORTING) { return; } LOG.info("begin execute export job in exporting state. job: {}", job); if (getLeftTimeSecond() < 0) { job.cancelInternal(ExportFailMsg.CancelType.TIMEOUT, "timeout");...
class ExportExportingTask extends PriorityLeaderTask { private static final Logger LOG = LogManager.getLogger(ExportExportingTask.class); private static final int RETRY_NUM = 2; protected final ExportJob job; private RuntimeProfile profile = new RuntimeProfile("Export"); private final List<Runtime...
class ExportExportingTask extends PriorityLeaderTask { private static final Logger LOG = LogManager.getLogger(ExportExportingTask.class); private static final int RETRY_NUM = 2; protected final ExportJob job; private RuntimeProfile profile = new RuntimeProfile("Export"); private final List<Runtime...
This will lose other configs in `configuration`, we can add a private `create(Configuration conf, EnvironmentSettings settings)` method as the basic implementation.
public static TableEnvironmentImpl create(Configuration configuration) { return create(EnvironmentSettings.fromConfiguration(configuration)); }
return create(EnvironmentSettings.fromConfiguration(configuration));
public static TableEnvironmentImpl create(Configuration configuration) { return create(EnvironmentSettings.fromConfiguration(configuration), configuration); }
class TableEnvironmentImpl implements TableEnvironmentInternal { private static final boolean IS_STREAM_TABLE = true; private final CatalogManager catalogManager; private final ModuleManager moduleManager; private final OperationTreeBuilder operationTreeBuilder; private final List<Mod...
class TableEnvironmentImpl implements TableEnvironmentInternal { private static final boolean IS_STREAM_TABLE = true; private final CatalogManager catalogManager; private final ModuleManager moduleManager; private final OperationTreeBuilder operationTreeBuilder; private final List<Mod...
feel like the condition should be `lockHolderRequest.locker.equals(this.locker) && !(this.lockType == LockType.READ && lockHolderRequest.lockType == LockType.WRITE)`
boolean isConflict(LockHolder lockHolderRequest) { if (lockHolderRequest.locker.equals(this.locker) && this.lockType == LockType.WRITE && lockHolderRequest.lockType == LockType.READ) { /* * If you acquire an exclusive lock first and then request a shared lock, you can su...
if (lockHolderRequest.locker.equals(this.locker)
boolean isConflict(LockHolder lockHolderRequest) { return this.lockType.isConflict(lockHolderRequest.getLockType()); }
class LockHolder implements Cloneable { private final Locker locker; private final LockType lockType; private int refCount; public LockHolder(Locker locker, LockType lockType) { this.locker = locker; this.lockType = lockType; this.refCount = 1; } public Locker getLocker...
class LockHolder implements Cloneable { private final Locker locker; private final LockType lockType; private int refCount; public LockHolder(Locker locker, LockType lockType) { this.locker = locker; this.lockType = lockType; this.refCount = 1; } public Locker getLocker...
Shall we check `future.isSuccess() && cause != null` as in other places?
private static void pingAutomatically(WebSocketControlMessage controlMessage) { WebSocketConnection webSocketConnection = controlMessage.getWebSocketConnection(); webSocketConnection.pong(controlMessage.getPayload()).addListener(future -> { Throwable cause = future.cause(); if (c...
if (cause != null) {
private static void pingAutomatically(WebSocketControlMessage controlMessage) { WebSocketConnection webSocketConnection = controlMessage.getWebSocketConnection(); webSocketConnection.pong(controlMessage.getPayload()).addListener(future -> { Throwable cause = future.cause(); if (!...
class WebSocketDispatcher { /** * This will find the best matching service for given web socket request. * * @param webSocketMessage incoming message. * @return matching service. */ public static WebSocketService findService(WebSocketServicesRegistry servicesRegistry, ...
class WebSocketDispatcher { /** * This will find the best matching service for given web socket request. * * @param webSocketMessage incoming message. * @return matching service. */ public static WebSocketService findService(WebSocketServicesRegistry servicesRegistry, ...
oops. This is a line that was not added intentionally. Have removed it.
public RelRoot rel(String sql, QueryParameters params) { RelOptCluster cluster = RelOptCluster.create(planner, new RexBuilder(typeFactory)); QueryTrait trait = new QueryTrait(); SqlAnalyzer analyzer = SqlAnalyzer.getBuilder() .withQueryParams(params) .withQueryTrait(trait) ...
LOG.info("SQLPlan>\n" + RelOptUtil.toString(convertedNode));
public RelRoot rel(String sql, QueryParameters params) { RelOptCluster cluster = RelOptCluster.create(planner, new RexBuilder(typeFactory)); QueryTrait trait = new QueryTrait(); SqlAnalyzer analyzer = SqlAnalyzer.getBuilder() .withQueryParams(params) .withQueryTrait(trait) ...
class ZetaSQLPlannerImpl implements Planner { private static final Logger LOG = Logger.getLogger(ZetaSQLPlannerImpl.class.getName()); private final SchemaPlus defaultSchemaPlus; private final FrameworkConfig config; private RelOptPlanner planner; private JavaTypeFactory typeFactory; private final RexEx...
class ZetaSQLPlannerImpl implements Planner { private static final Logger LOG = Logger.getLogger(ZetaSQLPlannerImpl.class.getName()); private final SchemaPlus defaultSchemaPlus; private final FrameworkConfig config; private RelOptPlanner planner; private JavaTypeFactory typeFactory; private final RexEx...
Any doc or evidence to support this behavior(if null, then true)?
public boolean isAllowCrossTenantReplication() { if (this.innerModel().allowCrossTenantReplication() == null) { return true; } return this.innerModel().allowCrossTenantReplication(); }
return true;
public boolean isAllowCrossTenantReplication() { if (this.innerModel().allowCrossTenantReplication() == null) { return true; } return this.innerModel().allowCrossTenantReplication(); }
class StorageAccountImpl extends GroupableResourceImpl<StorageAccount, StorageAccountInner, StorageAccountImpl, StorageManager> implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { private final ClientLogger logger = new ClientLogger(getClass()); private PublicEndpoints publicE...
class StorageAccountImpl extends GroupableResourceImpl<StorageAccount, StorageAccountInner, StorageAccountImpl, StorageManager> implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { private final ClientLogger logger = new ClientLogger(getClass()); private PublicEndpoints publicE...
It seems when a client is CLOSED, it will not start() again. Not sure if we need to make the client reuseable. Or we need to add some comments on closeAsync() API in case they may not release the client after close it?
public Mono<Void> start() { if (clientState.get() != WebPubSubClientState.STOPPED) { return Mono.error(logger.logExceptionAsError( new IllegalStateException("Failed to start. Client is not STOPPED."))); } return Mono.defer(() -> { isStoppedByU...
if (clientState.get() != WebPubSubClientState.STOPPED) {
public Mono<Void> start() { return this.start(null); }
class WebPubSubAsyncClient implements AsyncCloseable { private ClientLogger logger; private final Mono<String> clientAccessUriProvider; private final WebPubSubProtocol webPubSubProtocol; private final boolean autoReconnect; private final boolean autoRestoreGroup; private final...
class WebPubSubAsyncClient implements Closeable { private ClientLogger logger; private final AtomicReference<ClientLogger> loggerReference = new AtomicReference<>(); private final Mono<String> clientAccessUrlProvider; private final WebPubSubProtocol webPubSubProtocol; private final boole...
It's unfortunate that Jackson doesn't consider this as a breaking change.
public JacksonAdapter() { this.simpleMapper = initializeMapperBuilder(JsonMapper.builder()) .build(); this.headerMapper = initializeMapperBuilder(JsonMapper.builder()) .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES) .build(); this.xmlMapper = initializ...
* https:
public JacksonAdapter() { this.simpleMapper = initializeMapperBuilder(JsonMapper.builder()) .build(); this.headerMapper = initializeMapperBuilder(JsonMapper.builder()) .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES) .build(); this.xmlMapper = initi...
class JacksonAdapter implements SerializerAdapter { private static final Pattern PATTERN = Pattern.compile("^\"*|\"*$"); private final ClientLogger logger = new ClientLogger(JacksonAdapter.class); /** * An instance of {@link ObjectMapper} to serialize/deserialize objects. */ private final Ob...
class JacksonAdapter implements SerializerAdapter { private static final Pattern PATTERN = Pattern.compile("^\"*|\"*$"); private final ClientLogger logger = new ClientLogger(JacksonAdapter.class); /** * An instance of {@link ObjectMapper} to serialize/deserialize objects. */ private final Ob...
I see, however this works while a message exists in the exception, but some IO exceptions don't carry a message, that's why I suggested it to log the stacktrace too
LocalProject load() throws BootstrapMavenException { final AtomicReference<LocalProject> currentProject = new AtomicReference<>(); final Consumer<Model> processor; if (modelBuilder == null) { processor = rawModel -> { var project = new LocalProject(rawModel, workspace...
log.warn("Failed to resolve effective model for " + rawModel.getPomFile() + ": " + e);
LocalProject load() throws BootstrapMavenException { final AtomicReference<LocalProject> currentProject = new AtomicReference<>(); final Consumer<Model> processor; if (modelBuilder == null) { processor = rawModel -> { var project = new LocalProject(rawModel, workspace...
class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader { private static final Logger log = Logger.getLogger(WorkspaceLoader.class); private static final String POM_XML = "pom.xml"; private static Path locateCurrentProjectPom(Path path) throws BootstrapMavenException { Path p = p...
class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader { private static final Logger log = Logger.getLogger(WorkspaceLoader.class); private static final String POM_XML = "pom.xml"; private static Path locateCurrentProjectPom(Path path) throws BootstrapMavenException { Path p = p...
I thought about it, but this is a helper class, it's not a "junit" specific class, and I thought we shouldn't use `TemporaryFolder` directly. Another idea is to remove ctors with no `tmpWorkingDir` so it's a mandatory argument, and all consumers should be responsible to pass a directory path there, so all the tests usi...
public TestingTaskManagerRuntimeInfo() { this( new Configuration(), EnvironmentInformation.getTemporaryFileDirectory() .split(",|" + File.pathSeparator)); }
EnvironmentInformation.getTemporaryFileDirectory()
public TestingTaskManagerRuntimeInfo() { this( new Configuration(), EnvironmentInformation.getTemporaryFileDirectory() .split(",|" + File.pathSeparator)); }
class TestingTaskManagerRuntimeInfo implements TaskManagerRuntimeInfo { private final Configuration configuration; private final String[] tmpDirectories; private final String taskManagerExternalAddress; private final File tmpWorkingDirectory; public TestingTaskManagerRuntimeInfo(Configuratio...
class TestingTaskManagerRuntimeInfo implements TaskManagerRuntimeInfo { private final Configuration configuration; private final String[] tmpDirectories; private final String taskManagerExternalAddress; private final File tmpWorkingDirectory; public TestingTaskManagerRuntimeInfo(Configuratio...
Would this possibly happen? > Thread1: call subpartition.createReadView() - create view1 > Thread2: obtain a reference to view1 It is not possible to access to view1 through a different thread, unless downstream reconnects, meaning either thread1 releases the view upon disconnecting from downstream or a different th...
void releaseView() { LOG.info("Releasing view of subpartition {} of {}.", getSubPartitionIndex(), parent.getPartitionId()); readView = null; isPartialBuffer = true; isBlockedByCheckpoint = false; sequenceNumber = 0; }
readView = null;
void releaseView() { assert Thread.holdsLock(buffers); if (readView != null) { LOG.debug("Releasing view of subpartition {} of {}.", getSubPartitionIndex(), parent.getPartitionId()); readView.releaseAllResources(); readView = null; isPartialBufferCleanupRequired = true; isBlockedByCheckpoint = ...
class PipelinedApproximateSubpartition extends PipelinedSubpartition { private static final Logger LOG = LoggerFactory.getLogger(PipelinedApproximateSubpartition.class); private boolean isPartialBuffer = false; PipelinedApproximateSubpartition(int index, ResultPartition parent) { super(index, parent); } @Ove...
class PipelinedApproximateSubpartition extends PipelinedSubpartition { private static final Logger LOG = LoggerFactory.getLogger(PipelinedApproximateSubpartition.class); @GuardedBy("buffers") private boolean isPartialBufferCleanupRequired = false; PipelinedApproximateSubpartition(int index, ResultPartition paren...
this is more clear and simple: `for (Expr aggFnExpr : aggFnExprList) { for (Expr expr : groupByClause.getGroupingExprs()) { .... } }`
public void analyze(Analyzer analyzer) throws UserException { if (isAnalyzed()) { return; } super.analyze(analyzer); fromClause.setNeedToSql(needToSql); fromClause.analyze(analyzer); if (!analyzer.isWithClause()) { ...
if (!aggFnExprList.isEmpty()) {
public void analyze(Analyzer analyzer) throws UserException { if (isAnalyzed()) { return; } super.analyze(analyzer); fromClause.setNeedToSql(needToSql); fromClause.analyze(analyzer); if (!analyzer.isWithClause()) { ...
class SelectStmt extends QueryStmt { private static final Logger LOG = LogManager.getLogger(SelectStmt.class); private UUID id = UUID.randomUUID(); protected SelectList selectList; private final ArrayList<String> colLabels; protected final FromClause fromClause; protected GroupByCla...
class SelectStmt extends QueryStmt { private static final Logger LOG = LogManager.getLogger(SelectStmt.class); private UUID id = UUID.randomUUID(); protected SelectList selectList; private final ArrayList<String> colLabels; protected final FromClause fromClause; protected GroupByCla...
It'd be good to include the conflicting artifacts into the message.
public AppModel resolveModel(AppArtifact appArtifact) throws AppModelResolverException { if (appModel != null) { if (appModel.getAppArtifact().equals(appArtifact)) { return appModel; } else { throw new AppModelResolverException("Requested artifact does not...
throw new AppModelResolverException("Requested artifact does not match loaded model");
public AppModel resolveModel(AppArtifact appArtifact) throws AppModelResolverException { if (appModel != null) { if (appModel.getAppArtifact().equals(appArtifact)) { return appModel; } else { throw new AppModelResolverException( "Re...
class AppModelGradleResolver implements AppModelResolver { private AppModel appModel; private final Project project; private final QuarkusModel model; public AppModelGradleResolver(Project project, QuarkusModel model) { this.model = model; this.project = project; } @Override ...
class AppModelGradleResolver implements AppModelResolver { private AppModel appModel; private final Project project; private final QuarkusModel model; public AppModelGradleResolver(Project project, QuarkusModel model) { this.model = model; this.project = project; } @Override ...
Not sure if it's important for Undertow but I would have checked if the path ends with `/` before adding a `/`
ServletBuildItem createServlet() { ServletBuildItem servletBuildItem = new ServletBuildItem("metrics", SmallRyeMetricsServlet.class.getName()); servletBuildItem.getMappings().add(metrics.path + "/*"); return servletBuildItem; }
servletBuildItem.getMappings().add(metrics.path + "/*");
ServletBuildItem createServlet() { ServletBuildItem servletBuildItem = new ServletBuildItem("metrics", SmallRyeMetricsServlet.class.getName()); servletBuildItem.getMappings().add(metrics.path + (metrics.path.endsWith("/") ? "*" : "/*")); return servletBuildItem; }
class SmallRyeMetricsConfig { /** * The path to the metrics Servlet. */ @ConfigItem(defaultValue = "/metrics") String path; }
class SmallRyeMetricsConfig { /** * The path to the metrics Servlet. */ @ConfigItem(defaultValue = "/metrics") String path; }
The last flag should be true.
public void testStreamingResult() { ResultDescriptor resultDescriptor = new ResultDescriptor("", schema, true, true, false); TestingExecutor mockExecutor = new TestingExecutorBuilder() .setResultChangesSupplier( () -> ...
ResultDescriptor resultDescriptor = new ResultDescriptor("", schema, true, true, false);
public void testStreamingResult() { ResultDescriptor resultDescriptor = new ResultDescriptor("", schema, true, true, true); TestingExecutor mockExecutor = new TestingExecutorBuilder() .setResultChangesSupplier( () -> ...
class CliTableauResultViewTest { private ByteArrayOutputStream terminalOutput; private Terminal terminal; private TableSchema schema; private List<Row> data; private List<Row> streamingData; @Before public void setUp() { terminalOutput = new ByteArrayOutputStream(); termina...
class CliTableauResultViewTest { private ByteArrayOutputStream terminalOutput; private Terminal terminal; private TableSchema schema; private List<Row> data; private List<Row> streamingData; @Before public void setUp() { terminalOutput = new ByteArrayOutputStream(); termina...
We might pick currentWork more than one time from workQueue. `currentTimeoutOperation == null` will indicate that are we picking up first time. We do not need to process currentWork if is picked up second time and no bufferMessages to send to it. `while ((currentWork = workQueue.peek()) != null && (currentTimeout...
private void drainQueue() { if (isTerminated()) { return; } synchronized (currentWorkLock) { if (currentWork != null && currentWork.isTerminal()) { workQueue.remove(currentWork); if (currentTimeoutOperation != null &...
currentTimeoutOperation = null;
private void drainQueue() { if (isTerminated()) { return; } synchronized (currentWorkLock) { if (currentWork != null && currentWork.isTerminal()) { workQueue.remove(currentWork); if (currentTimeoutOperation != null &...
class SynchronousMessageSubscriber extends BaseSubscriber<ServiceBusReceivedMessageContext> { private final ClientLogger logger = new ClientLogger(SynchronousMessageSubscriber.class); private final AtomicBoolean isDisposed = new AtomicBoolean(); private final AtomicInteger wip = new AtomicInteger(); pri...
class SynchronousMessageSubscriber extends BaseSubscriber<ServiceBusReceivedMessageContext> { private final ClientLogger logger = new ClientLogger(SynchronousMessageSubscriber.class); private final AtomicBoolean isDisposed = new AtomicBoolean(); private final AtomicInteger wip = new AtomicInteger(); pri...
what is the difference between isReferenceEqual and isEqual for simple basic types?
public static boolean isReferenceEqual(Object lhsValue, Object rhsValue) { if (lhsValue == rhsValue) { return true; } if (lhsValue == null || rhsValue == null) { return false; } Type lhsType = getType(lhsValue); Type rhsType = getType(rh...
if (rhsType.getTag() != TypeTags.BYTE_TAG || rhsType.getTag() != TypeTags.INT_TAG) {
public static boolean isReferenceEqual(Object lhsValue, Object rhsValue) { if (lhsValue == rhsValue) { return true; } if (lhsValue == null || rhsValue == null) { return false; } Type lhsType = getType(lhsValue); Type rhsType = getType(rh...
class TypeChecker { public static Object checkCast(Object sourceVal, Type targetType) { if (checkIsType(sourceVal, targetType)) { return sourceVal; } Type sourceType = getType(sourceVal); if (sourceType.getTag() <= TypeTags.BOOLEAN_TAG && targetType.getTag() <= TypeTag...
class TypeChecker { public static Object checkCast(Object sourceVal, Type targetType) { if (checkIsType(sourceVal, targetType)) { return sourceVal; } Type sourceType = getType(sourceVal); if (sourceType.getTag() <= TypeTags.BOOLEAN_TAG && targetType.getTag() <= TypeTag...
This is created after decoding the org and name values. So I guess `pkg.packageID` and `currentPkgId` could be different
private void rewriteAsyncInvocations(BIRFunction func, BIRTypeDefinition attachedTypeDef, BIRPackage pkg) { PackageID packageID = pkg.packageID; Name org = new Name(IdentifierUtils.decodeIdentifier(packageID.orgName.getValue())); Name module = new Name(IdentifierUtils.decodeIdentifier(packageID....
List<BIRFunction> scopeFunctionsList;
private void rewriteAsyncInvocations(BIRFunction func, BIRTypeDefinition attachedTypeDef, BIRPackage pkg) { PackageID packageID = pkg.packageID; Name org = new Name(IdentifierUtils.decodeIdentifier(packageID.orgName.getValue())); Name module = new Name(IdentifierUtils.decodeIdentifier(packageID....
class JvmObservabilityGen { private static final String ENTRY_POINT_MAIN_METHOD_NAME = "main"; private static final String NEW_BB_PREFIX = "observabilityDesugaredBB"; private static final String SERVICE_IDENTIFIER = "$$service$"; private static final String ANONYMOUS_SERVICE_IDENTIFIER = "$anonService$"...
class JvmObservabilityGen { private static final String ENTRY_POINT_MAIN_METHOD_NAME = "main"; private static final String NEW_BB_PREFIX = "observabilityDesugaredBB"; private static final String SERVICE_IDENTIFIER = "$$service$"; private static final String INVOCATION_INSTRUMENTATION_TYPE = "invocation"...
perhaps? I can't say definitively, but: it is already in [the `DeprecatedPrimitives` section of the proto](https://github.com/apache/beam/blob/a6897100e34cf2b6f177d261f65678c4ff8c7616/model/pipeline/src/main/proto/beam_runner_api.proto#L238) is it always implemented as a composite / in terms of other primitives? we'...
static Collection<String> getPrimitiveTransformIds(RunnerApi.Components components) { Collection<String> ids = new LinkedHashSet<>(); for (Map.Entry<String, PTransform> transformEntry : components.getTransformsMap().entrySet()) { PTransform transform = transformEntry.getValue(); boolean isPrimitive...
if (isPrimitive) {
static Collection<String> getPrimitiveTransformIds(RunnerApi.Components components) { Collection<String> ids = new LinkedHashSet<>(); for (Map.Entry<String, PTransform> transformEntry : components.getTransformsMap().entrySet()) { PTransform transform = transformEntry.getValue(); boolean isPrimitive...
class QueryablePipeline { /** * Create a new {@link QueryablePipeline} based on the provided components. * * <p>The returned {@link QueryablePipeline} will contain only the primitive transforms present * within the provided components. */ public static QueryablePipeline forPrimitivesIn(Co...
class QueryablePipeline { /** * Create a new {@link QueryablePipeline} based on the provided components. * * <p>The returned {@link QueryablePipeline} will contain only the primitive transforms present * within the provided components. */ public static QueryablePipeline forPrimitivesIn(Co...
This can return any constructor - you first need to look for `@Inject` constructor and if not present, then for no-args one.
private void addConstructorLevelBindings(ClassInfo classInfo, Collection<AnnotationInstance> bindings) { MethodInfo constructor = classInfo.method(Methods.INIT); if (constructor == null) { Optional<Injection> constructorWithInject = injections.stream().filter(Injection::isConstructor).findAn...
MethodInfo constructor = classInfo.method(Methods.INIT);
private void addConstructorLevelBindings(ClassInfo classInfo, Collection<AnnotationInstance> bindings) { MethodInfo constructor; Optional<Injection> constructorWithInject = getConstructorInjection(); if (constructorWithInject.isPresent()) { constructor = constructorWithInject.get().t...
class or null in case of a producer of a primitive type or an array */ public ClassInfo getImplClazz() { return implClazz; }
class or null in case of a producer of a primitive type or an array */ public ClassInfo getImplClazz() { return implClazz; }
nit: it would make me happier if this.feeder was initialized before the RemoteBundle is created so we don't have to worry about NPE.
new BundleProgressHandler() { @Override public void onProgress(ProcessBundleProgressResponse progress) { if (progress.hasSplit()) { feeder.split(progress.getSplit()); } } ...
feeder.split(progress.getSplit());
new BundleProgressHandler() { @Override public void onProgress(ProcessBundleProgressResponse progress) { if (progress.hasSplit()) { feeder.split(progress.getSplit()); } } ...
class SplittableRemoteStageEvaluator<InputT, RestrictionT> implements TransformEvaluator<KeyedWorkItem<byte[], KV<InputT, RestrictionT>>> { private final PTransformNode transform; private final ExecutableStage stage; private final CopyOnAccessInMemoryStateInternals<byte[]> stateInternals; private...
class SplittableRemoteStageEvaluator<InputT, RestrictionT> implements TransformEvaluator<KeyedWorkItem<byte[], KV<InputT, RestrictionT>>> { private final PTransformNode transform; private final ExecutableStage stage; private final CopyOnAccessInMemoryStateInternals<byte[]> stateInternals; private...
> but small costs pile up You would need a loooot of `return "";` statements to see a very tiny cost but I get your point and the PR is updated now ;-). > Certainly not worth blocking the PR thus why I approved anyway and let you decide what to do :). > (I wouldn't have asked if it made the code worse or more comple...
String replacePathParameters(String path) { if (path.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(); Matcher m = PATH_PARAM_PATTERN.matcher(path); while (m.find()) { String match = m.group(); String paramName = ma...
return "";
String replacePathParameters(String path) { if (path.isEmpty()) { return path; } StringBuilder sb = new StringBuilder(); Matcher m = PATH_PARAM_PATTERN.matcher(path); while (m.find()) { String match = m.group(); String paramName = ...
class WebSocketConnectorBase<THIS extends WebSocketConnectorBase<THIS>> { protected static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z0-9_]+\\}"); protected URI baseUri; protected final Map<String, String> pathParams; protected final Map<String, List<String>> headers; p...
class WebSocketConnectorBase<THIS extends WebSocketConnectorBase<THIS>> { protected static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z0-9_]+\\}"); protected URI baseUri; protected final Map<String, String> pathParams; protected final Map<String, List<String>> headers; p...
In order to get the flag value for a particular application, you need to tell the flag what application this is for before value() with a call to `with(Dimension.APPLICATION_ID, anApplicationId.serializedForm())`
private NodesSpecification createNodesSpecificationForLogserver() { DeployState deployState = context.getDeployState(); if (deployState.getProperties().useDedicatedNodeForLogserver() && context.getApplicationType() == ConfigModelContext.ApplicationType.DEFAULT && ...
Flags.ENABLE_LOGSERVER.bindTo(deployState.flagSource()).value())
private NodesSpecification createNodesSpecificationForLogserver() { DeployState deployState = context.getDeployState(); if (deployState.getProperties().useDedicatedNodeForLogserver() && context.getApplicationType() == ConfigModelContext.ApplicationType.DEFAULT && ...
class DomAdminV4Builder extends DomAdminBuilderBase { private ApplicationId ZONE_APPLICATION_ID = ApplicationId.from("hosted-vespa", "routing", "default"); private final Collection<ContainerModel> containerModels; private final ConfigModelContext context; public DomAdminV4Builder(ConfigModelContext c...
class DomAdminV4Builder extends DomAdminBuilderBase { private ApplicationId ZONE_APPLICATION_ID = ApplicationId.from("hosted-vespa", "routing", "default"); private final Collection<ContainerModel> containerModels; private final ConfigModelContext context; public DomAdminV4Builder(ConfigModelContext c...
If `databases` is a `Stream<String>` you wouldn't need to collect the filtering results. ``` Stream<String> databases = ctx.getCatalogManager().getCatalogOrThrowException(cName).listDatabases().stream(); if (likeType != null) { databases = databases ...
public TableResultInternal execute(Context ctx) { String cName = catalogName == null ? ctx.getCatalogManager().getCurrentCatalog() : catalogName; List<String> databases = ctx.getCatalogManager().getCatalogOrThrowException(cName).listDatabases(); if (likeType != n...
"database name", databases.stream().sorted().toArray(String[]::new));
public TableResultInternal execute(Context ctx) { String cName = catalogName == null ? ctx.getCatalogManager().getCurrentCatalog() : catalogName; Stream<String> databases = ctx.getCatalogManager().getCatalogOrThrowException(cName).listDatabases().stream(); if (li...
class ShowDatabasesOperation implements ShowOperation { private final String preposition; private final String catalogName; private final LikeType likeType; private final String likePattern; private final boolean notLike; public ShowDatabasesOperation() { this.preposition = nu...
class ShowDatabasesOperation implements ShowOperation { private final String catalogName; private final LikeType likeType; private final String likePattern; private final boolean notLike; public ShowDatabasesOperation() { this(null, null, null, false); } public ShowDataba...
BELatencyInMs is just the JSON output so it doesn't need to follow Java or c# convention. I don't see a reason to spell out BackendEnd and bloat the diagnostics even further when BE is easily understandable. I would argue that we should use latency because that is the name of the header. If anything the backend implem...
public String toString() { int statusCode = 0; int subStatusCode = HttpConstants.SubStatusCodes.UNKNOWN; if (this.storeResponse != null) { statusCode = this.storeResponse.getStatus(); subStatusCode = this.storeResponse.getSubStatusCode(); } else if (this.exceptio...
", backendLatencyInMs: " + this.backendLatencyInMs +
public String toString() { int statusCode = 0; int subStatusCode = HttpConstants.SubStatusCodes.UNKNOWN; if (this.storeResponse != null) { statusCode = this.storeResponse.getStatus(); subStatusCode = this.storeResponse.getSubStatusCode(); } else if (this.exceptio...
class StoreResult { private final static Logger logger = LoggerFactory.getLogger(StoreResult.class); private final StoreResponse storeResponse; private final CosmosException exception; final public long lsn; final public String partitionKeyRangeId; final public long quorumAckedLSN; final p...
class StoreResult { private final static Logger logger = LoggerFactory.getLogger(StoreResult.class); private final StoreResponse storeResponse; private final CosmosException exception; final public long lsn; final public String partitionKeyRangeId; final public long quorumAckedLSN; final p...
Use user who create this job?
public void before() throws JobException { if (isCanceled.get()) { throw new JobException("Export executor has been canceled, task id: {}", getTaskId()); } ctx = new ConnectContext(); ctx.setEnv(Env.getCurrentEnv()); ctx.setCluster(SystemInfoService.DEFAULT_CLUSTER); ...
ctx.setQualifiedUser(Auth.ADMIN_USER);
public void before() throws JobException { if (isCanceled.get()) { throw new JobException("Export executor has been canceled, task id: {}", getTaskId()); } ctx = new ConnectContext(); ctx.setEnv(Env.getCurrentEnv()); ctx.setCluster(SystemInfoService.DEFAULT_CLUSTER); ...
class InsertTask extends AbstractTask { private String labelName; private InsertIntoTableCommand command; private StmtExecutor stmtExecutor; private ConnectContext ctx; private String sql; private String currentDb; private AtomicBoolean isCanceled = new AtomicBoolean(false); priv...
class InsertTask extends AbstractTask { private String labelName; private InsertIntoTableCommand command; private StmtExecutor stmtExecutor; private ConnectContext ctx; private String sql; private String currentDb; private UserIdentity userIdentity; private AtomicBoolean isCancel...
I used this format to avoid codecov warnings for the last line in this method.
private BType getMapType(BType type) { BType refType = Types.getReferredType(type); BType resultantType = symTable.mapType; if (refType.tag == TypeTags.UNION) { for (BType memberType : ((BUnionType) type).getMemberTypes()) { BType resultType = getMapType(memberType); ...
resultantType = getMapType(((BIntersectionType) refType).effectiveType);
private BType getMapType(BType type) { BType resultantType = types.getSafeType(Types.getReferredType(type), false, true); if (resultantType.tag == TypeTags.INTERSECTION) { return getMapType(((BIntersectionType) resultantType).effectiveType); } return resultantType; }
class QueryDesugar extends BLangNodeVisitor { private static final Name QUERY_CREATE_PIPELINE_FUNCTION = new Name("createPipeline"); private static final Name QUERY_CREATE_INPUT_FUNCTION = new Name("createInputFunction"); private static final Name QUERY_CREATE_NESTED_FROM_FUNCTION = new Name("createNestedFr...
class QueryDesugar extends BLangNodeVisitor { private static final Name QUERY_CREATE_PIPELINE_FUNCTION = new Name("createPipeline"); private static final Name QUERY_CREATE_INPUT_FUNCTION = new Name("createInputFunction"); private static final Name QUERY_CREATE_NESTED_FROM_FUNCTION = new Name("createNestedFr...
Two main comments: 1) Let's filter out tables from the schema that are not tracked by change streams. We don't want to cache tables in the schema if they are not tracked by change streams. 2) Let's filter out columns from a change stream-tracked table if they are not tracked by change streams. Three potential cases:...
public PCollectionRowTuple expand(PCollectionRowTuple input) { Pipeline p = input.getPipeline(); Schema tableChangesSchema = getTableSchema(configuration); SpannerIO.ReadChangeStream readChangeStream = SpannerIO.readChangeStream() .wit...
Schema tableChangesSchema = getTableSchema(configuration);
public PCollectionRowTuple expand(PCollectionRowTuple input) { Pipeline p = input.getPipeline(); Schema tableChangesSchema = getTableSchema(configuration); SpannerIO.ReadChangeStream readChangeStream = SpannerIO.readChangeStream() .wit...
class SpannerChangestreamsReadSchemaTransformProvider extends TypedSchemaTransformProvider< SpannerChangestreamsReadSchemaTransformProvider.SpannerChangestreamsReadConfiguration> { @Override protected @UnknownKeyFor @NonNull @Initialized Class<SpannerChangestreamsReadConfiguration> configurationCl...
class SpannerChangestreamsReadSchemaTransformProvider extends TypedSchemaTransformProvider< SpannerChangestreamsReadSchemaTransformProvider.SpannerChangestreamsReadConfiguration> { @Override protected @UnknownKeyFor @NonNull @Initialized Class<SpannerChangestreamsReadConfiguration> configurationCl...
```suggestion String maxDate = DateLiteral.createMaxValue(Type.DATE).getStringValue(); ``` minInt -> maxInt? minDate -> maxDate?
public List<PartitionInfo> getPartitions(Table table, List<String> partitionNames) { try (Connection connection = getConnection()) { List<Partition> partitions = schemaResolver.getPartitions(connection, table); String minInt = IntLiteral.createMaxValue(Type.INT).getStringValue(); ...
String minDate = DateLiteral.createMaxValue(Type.DATE).getStringValue();
public List<PartitionInfo> getPartitions(Table table, List<String> partitionNames) { try (Connection connection = getConnection()) { List<Partition> partitions = schemaResolver.getPartitions(connection, table); String maxInt = IntLiteral.createMaxValue(Type.INT).getStringValue(); ...
class JDBCMetadata implements ConnectorMetadata { private static Logger LOG = LogManager.getLogger(JDBCMetadata.class); private Map<String, String> properties; private String catalogName; private JDBCSchemaResolver schemaResolver; public JDBCMetadata(Map<String, String> properties, String catalog...
class JDBCMetadata implements ConnectorMetadata { private static Logger LOG = LogManager.getLogger(JDBCMetadata.class); private Map<String, String> properties; private String catalogName; private JDBCSchemaResolver schemaResolver; public JDBCMetadata(Map<String, String> properties, String catalog...
this can be simplified now right? you don't need an intermediate list, but we can start writing to the buf directly from the loop?
private void writeFunctionsGlobalVarDependency(ByteBuf buf, BIRNode.BIRFunction birFunction) { List<Integer> globalVarBuf = new LinkedList<>(); for (BIRNode.BIRVariableDcl var : birFunction.dependentGlobalVars) { globalVarBuf.add(addStringCPEntry(var.name.value)); } buf.wri...
globalVarBuf.forEach(buf::writeInt);
private void writeFunctionsGlobalVarDependency(ByteBuf buf, BIRNode.BIRFunction birFunction) { buf.writeInt(birFunction.dependentGlobalVars.size()); for (BIRNode.BIRVariableDcl var : birFunction.dependentGlobalVars) { buf.writeInt(addStringCPEntry(var.name.value)); } }
class BIRBinaryWriter { private final ConstantPool cp = new ConstantPool(); private final BIRNode.BIRPackage birPackage; public BIRBinaryWriter(BIRNode.BIRPackage birPackage) { this.birPackage = birPackage; } public byte[] serialize() { ByteBuf birbuf = Unpooled.buffer(); ...
class BIRBinaryWriter { private final ConstantPool cp = new ConstantPool(); private final BIRNode.BIRPackage birPackage; public BIRBinaryWriter(BIRNode.BIRPackage birPackage) { this.birPackage = birPackage; } public byte[] serialize() { ByteBuf birbuf = Unpooled.buffer(); ...
`writeCallMetric` and `readCallMetric` look almost identical except `METHOD` field. Is it possible to refactor the common part into a separate method?
public static ServiceCallMetric writeCallMetric(TableReference tableReference) { if (tableReference != null) { HashMap<String, String> baseLabels = new HashMap<String, String>(); baseLabels.put(MonitoringInfoConstants.Labels.PTRANSFORM, ""); baseLabels.put(MonitoringInfoConstants.Lab...
baseLabels.put(MonitoringInfoConstants.Labels.PTRANSFORM, "");
public static ServiceCallMetric writeCallMetric(TableReference tableReference) { return callMetricForMethod(tableReference, "BigQueryBatchWrite"); }
class ToTableRow<T> implements SerializableFunction<T, TableRow> { private final SerializableFunction<T, Row> toRow; ToTableRow(SerializableFunction<T, Row> toRow) { this.toRow = toRow; } @Override public TableRow apply(T input) { return toTableRow(toRow.apply(input)); } }
class ToTableRow<T> implements SerializableFunction<T, TableRow> { private final SerializableFunction<T, Row> toRow; ToTableRow(SerializableFunction<T, Row> toRow) { this.toRow = toRow; } @Override public TableRow apply(T input) { return toTableRow(toRow.apply(input)); } }
I'm still not convinced about this test. It's reimplementing production code in many aspects. For example exception handling (this exception ignoring during cancelation/closing) and threading model from `Task`/`StreamTask`, so at any time we modify those, this test has a chance to fail. Also I'm pretty sure there are...
private Callable<Void> readRecoveredStateTask(RecoveredInputChannel inputChannel, ChannelStateReader reader, boolean verifyRelease) { return () -> { try { inputChannel.readRecoveredState(reader); } catch (Throwable t) { assertTrue("The expected exception should only happen in the case of released channe...
assertTrue("The expected exception should only happen in the case of released channel.", verifyRelease && inputChannel.isReleased());
private Callable<Void> readRecoveredStateTask(RecoveredInputChannel inputChannel, ChannelStateReader reader, boolean verifyRelease) { return () -> { try { inputChannel.readRecoveredState(reader); } catch (Throwable t) { if (!(verifyRelease && inputChannel.isReleased())) { throw new AssertionError("...
class RecoveredInputChannelTest { private final boolean isRemote; @Parameterized.Parameters(name = "isRemote = {0}") public static Collection<Object[]> parameters() { return Arrays.asList(new Object[][] { {true}, {false}, }); } public RecoveredInputChannelTest(boolean isRemote) { this.isRemote = isR...
class RecoveredInputChannelTest { private final boolean isRemote; @Parameterized.Parameters(name = "isRemote = {0}") public static Collection<Object[]> parameters() { return Arrays.asList(new Object[][] { {true}, {false}, }); } public RecoveredInputChannelTest(boolean isRemote) { this.isRemote = isR...
True. Maybe we need some more methods :)
public NativeImageInvokerInfo build() { List<String> nativeImageArgs = new ArrayList<>(); boolean enableSslNative = false; boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis; boolean addAllCharsets = nativeConfig.addAllCharsets; ...
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_22_3_0) >= 0) {
public NativeImageInvokerInfo build() { List<String> nativeImageArgs = new ArrayList<>(); boolean enableSslNative = false; boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis; boolean addAllCharsets = nativeConfig.addAllCharsets; ...
class Builder { private NativeConfig nativeConfig; private LocalesBuildTimeConfig localesBuildTimeConfig; private OutputTargetBuildItem outputTargetBuildItem; private List<NativeImageSystemPropertyBuildItem> nativeImageProperties; private List<ExcludeConfigBui...
class Builder { private NativeConfig nativeConfig; private LocalesBuildTimeConfig localesBuildTimeConfig; private OutputTargetBuildItem outputTargetBuildItem; private List<NativeImageSystemPropertyBuildItem> nativeImageProperties; private List<ExcludeConfigBui...
If possible, collections (Set, List, ...) in ShardingSphere are declared as Collection<x>
private void processSuccess() throws SQLException { final List<Long> orderIds = insertData(); assertThat(this.selectAll(), equalTo(Arrays.asList( new Order(1, 0, 2, 2, "INSERT_TEST"), new Order(2, 0, 4, 4, "INSERT_TEST"), new Order(3, 0, 6, 6, "INSERT_TEST...
final List<Long> orderIds = insertData();
private void processSuccess() throws SQLException { final Collection<Long> orderIds = insertData(); assertThat(this.selectAll(), equalTo(Arrays.asList( new Order(1, 0, 2, 2, "INSERT_TEST"), new Order(2, 0, 4, 4, "INSERT_TEST"), new Order(3, 0, 6, 6, "INSER...
class ShadowTest { private OrderRepository orderRepository; private OrderItemRepository orderItemRepository; private AddressRepository addressRepository; @Test void testShadowInLocalTransactions() throws SQLException, IOException { DataSource dataSource = YamlShardingSphe...
class ShadowTest { private OrderRepository orderRepository; private OrderItemRepository orderItemRepository; private AddressRepository addressRepository; @Test void testShadowInLocalTransactions() throws SQLException, IOException { DataSource dataSource = YamlShardingSphe...
Use the sendDropTabletTasks directly, we are just in the Catalog class.
public void dropDb(DropDbStmt stmt) throws DdlException { String dbName = stmt.getDbName(); if (!tryLock(false)) { throw new DdlException("Failed to acquire catalog lock. Try again"); } try { if (!fullNameToDb.containsKey(dbName)) { if (s...
Catalog.getCurrentCatalog().sendDropTabletTasks(batchTaskMap);
public void dropDb(DropDbStmt stmt) throws DdlException { String dbName = stmt.getDbName(); if (!tryLock(false)) { throw new DdlException("Failed to acquire catalog lock. Try again"); } try { if (!fullNameToDb.containsKey(dbName)) { if (s...
class SingletonHolder { private static final Catalog INSTANCE = new Catalog(); }
class SingletonHolder { private static final Catalog INSTANCE = new Catalog(); }
Sorry for the bad wording in the question. What I meant to ask was: If an application has no global service id and no rotations, why log here? I.e. shouldn't you only log when rotation set is empty?
void writeContainerEndpointsZK(Optional<String> globalServiceId) { if (!params.containerEndpoints().isEmpty()) { containerEndpoints.write(applicationId, params.containerEndpoints()); } else { if (globalServiceId.isEmpty()) { log.log(LogLevel....
log.log(LogLevel.WARNING, "Want to write rotations " + rotationsSet + " as container endpoints, but " + applicationId + " has no global-service-id. This should not happen");
void writeContainerEndpointsZK(Optional<String> globalServiceId) { if (!params.containerEndpoints().isEmpty()) { containerEndpoints.write(applicationId, params.containerEndpoints()); } else { if (!rotationsSet.isEmpty()) { if (globalServiceId...
class Preparation { final SessionContext context; final DeployLogger logger; final PrepareParams params; final Optional<ApplicationSet> currentActiveApplicationSet; final Path tenantPath; final ApplicationId applicationId; /** The version of Vespa the applicati...
class Preparation { final SessionContext context; final DeployLogger logger; final PrepareParams params; final Optional<ApplicationSet> currentActiveApplicationSet; final Path tenantPath; final ApplicationId applicationId; /** The version of Vespa the applicati...
shall we test when it is a `const` as in the issue?
public void testBitwiseUnsignedRightShiftOperator3() { int a = 0xff; long i = -23445834; long j = 5; invokeUnsignedRightShiftOperatorTestFunction(a, i, j); }
invokeUnsignedRightShiftOperatorTestFunction(a, i, j);
public void testBitwiseUnsignedRightShiftOperator3() { int a = 0xff; long i = -23445834; long j = 5; invokeUnsignedRightShiftOperatorTestFunction(a, i, j); }
class BByteValueTest { private CompileResult result; @BeforeClass(alwaysRun = true) public void setup() { result = BCompileUtil.compile("test-src/types/byte/byte-value.bal"); } @Test(description = "Test byte value assignment") public void testByteValue() { BValue[] returns = BR...
class BByteValueTest { private CompileResult result; @BeforeClass(alwaysRun = true) public void setup() { result = BCompileUtil.compile("test-src/types/byte/byte-value.bal"); } @Test(description = "Test byte value assignment") public void testByteValue() { BValue[] returns = BR...
I saw significantly lower system cpu when hardcoding it yesterday. However I did a lot of different tests then, and I am not putting more into it than it is a dimension that should be tested further. And for that to happen I need config control over it.
public Connection(TransportThread parent, Supervisor owner, Spec spec, Object context, boolean tcpNoDelay) { super(context); this.parent = parent; this.owner = owner; this.spec = spec; this.tcpNoDelay = tcpNoDelay; server = false; owner.sessionInit(this); }
this.tcpNoDelay = tcpNoDelay;
public Connection(TransportThread parent, Supervisor owner, Spec spec, Object context, boolean tcpNoDelay) { super(context); this.parent = parent; this.owner = owner; this.spec = spec; this.tcpNoDelay = tcpNoDelay; server = false; owner.sessionInit(this); }
class Connection extends Target { private static final Logger log = Logger.getLogger(Connection.class.getName()); private static final int READ_SIZE = 32768; private static final int READ_REDO = 10; private static final int WRITE_SIZE = 32768; private static final int WRITE_REDO = 10; priva...
class Connection extends Target { private static final Logger log = Logger.getLogger(Connection.class.getName()); private static final int READ_SIZE = 32768; private static final int READ_REDO = 10; private static final int WRITE_SIZE = 32768; private static final int WRITE_REDO = 10; priva...
I think this is subjective. Also, I will be adding more false statements to the method for this change. Think code is obvious anyway. I prefer to keep the code as it is if there is no objection.
private boolean isReadonlyType(BType sourceType) { if (isValueType(sourceType)) { return true; } switch (sourceType.tag) { case TypeTags.NIL: case TypeTags.ERROR: case TypeTags.INVOKABLE: case TypeTags.SERVICE: case TypeTag...
return true;
private boolean isReadonlyType(BType sourceType) { if (isValueType(sourceType)) { return true; } switch (sourceType.tag) { case TypeTags.NIL: case TypeTags.ERROR: case TypeTags.INVOKABLE: case TypeTags.SERVICE: case TypeTag...
class Types { private static final CompilerContext.Key<Types> TYPES_KEY = new CompilerContext.Key<>(); private SymbolTable symTable; private SymbolResolver symResolver; private BLangDiagnosticLogHelper dlogHelper; private Names names; private int finiteTypeCount = 0; private BU...
class Types { private static final CompilerContext.Key<Types> TYPES_KEY = new CompilerContext.Key<>(); private SymbolTable symTable; private SymbolResolver symResolver; private BLangDiagnosticLogHelper dlogHelper; private Names names; private int finiteTypeCount = 0; private BU...
I think this deserves a "final" here, and the line below too.
public static void main(String[] args) throws Exception { ServerConfiguration configuration = new ServerConfiguration(); CmdLineParser parser = new CmdLineParser(configuration); try { parser.parseArgument(args); fromConfig(configuration).run(); } catch (CmdLineException e) { LOG.error(...
ServerConfiguration configuration = new ServerConfiguration();
public static void main(String[] args) throws Exception { final ServerConfiguration configuration = new ServerConfiguration(); final CmdLineParser parser = new CmdLineParser(configuration); try { parser.parseArgument(args); fromConfig(configuration).run(); } catch (CmdLineException e) { ...
class ServerConfiguration { @Option(name = "--job-port", usage = "The job service port. (Default: 11440)") private int jobPort = 11440; @Option(name = "--control-port", usage = "The FnControl port. (Default: 11441)") private int controlPort = 11441; }
class ServerConfiguration { @Option(name = "--job-port", usage = "The job service port. (Default: 11440)") private int jobPort = 11440; @Option(name = "--control-port", usage = "The FnControl port. (Default: 11441)") private int controlPort = 11441; }
Ok, I'll need to update the rhoas operator and do a new release. Do you mind if we remove this property in a future pr, or are you planning on removing support for it in the very near (this calendar year) future.
public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> serviceBindings) { var matchingByType = ServiceBinding.singleMatchingByType("serviceregistry", serviceBindings); Config config = ConfigProvider.getConfig(); if (matchingByType.isEmpty()) { return Optional.empty(...
String realm = binding.getProperties().get("oauthRealm");
public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> serviceBindings) { var matchingByType = ServiceBinding.singleMatchingByType("serviceregistry", serviceBindings); Config config = ConfigProvider.getConfig(); if (matchingByType.isEmpty()) { return Optional.empty(...
class ServiceRegistryBindingConverter implements ServiceBindingConverter { private static Logger LOG = Logger.getLogger(ServiceRegistryBindingConverter.class.getName()); private static final String INCOMING_PREFIX = "mp.messaging.incoming."; private static final String OUTGOING_PREFIX = "mp.messaging.outg...
class ServiceRegistryBindingConverter implements ServiceBindingConverter { private static Logger LOG = Logger.getLogger(ServiceRegistryBindingConverter.class.getName()); private static final String INCOMING_PREFIX = "mp.messaging.incoming."; private static final String OUTGOING_PREFIX = "mp.messaging.outg...
@aoyvx Please remove final modifier in method domain.
public void assertRemoveSchemaMetadata() { final Map<String, ShardingSphereSchema> map = Maps.of( "foo_db_1", mock(ShardingSphereSchema.class), "foo_db_2", mock(ShardingSphereSchema.class)); final FederationDatabaseMetaData federationDatabaseMetaData = new FederationDatab...
final Map<String, ShardingSphereSchema> map = Maps.of(
public void assertRemoveSchemaMetadata() { Map<String, ShardingSphereSchema> map = new HashMap<>(); map.put("foo_db_1", mock(ShardingSphereSchema.class)); map.put("foo_db_2", mock(ShardingSphereSchema.class)); FederationDatabaseMetaData federationDatabaseMetaData = new FederationDatabase...
class FederationDatabaseMetaDataTest { @Test public void assertPutSchemaMetadata() { final FederationDatabaseMetaData federationDatabaseMetaData = new FederationDatabaseMetaData("foo", Collections.emptyMap()); final FederationSchemaMetaData schemaMetaData = mock(FederationSc...
class FederationDatabaseMetaDataTest { @Test public void assertPutSchemaMetadata() { FederationDatabaseMetaData federationDatabaseMetaData = new FederationDatabaseMetaData("foo", Collections.emptyMap()); FederationSchemaMetaData schemaMetaData = mock(FederationSchemaMetaData...
should use global var for WS and NL
public OnFailClauseNode transform(OnFailClauseNode onFailClauseNode) { Token onKeyword = formatToken(onFailClauseNode.onKeyword(), 1, 0); Token failKeyword = formatToken(onFailClauseNode.failKeyword(), 1, 0); TypeDescriptorNode typeDescriptor = formatNode(onFailClauseNode.typeDescriptor(), 1, 0)...
BlockStatementNode blockStatement = formatNode(onFailClauseNode.blockStatement(), 0, 1);
public OnFailClauseNode transform(OnFailClauseNode onFailClauseNode) { Token onKeyword = formatToken(onFailClauseNode.onKeyword(), 1, 0); Token failKeyword = formatToken(onFailClauseNode.failKeyword(), 1, 0); TypeDescriptorNode typeDescriptor = formatNode(onFailClauseNode.typeDescriptor(), 1, 0)...
class NewFormattingTreeModifier extends FormattingTreeModifier { /** * Number of of whitespace characters to be used as the indentation for the current line. */ private int indentation = 0; /** * Number of leading newlines to be added to the currently processing node. */ private in...
class NewFormattingTreeModifier extends FormattingTreeModifier { /** * Number of of whitespace characters to be used as the indentation for the current line. */ private int indentation = 0; /** * Number of leading newlines to be added to the currently processing node. */ private in...
This should set to 'TLS'. It's effectively setting max TLS version, disabling TLSv1.3 even when it's listed in `enableProtocols`. See table in https://bugs.openjdk.java.net/browse/JDK-8202625.
private String createTlsQuorumConfig(ZookeeperServerConfig config) { StringBuilder sb = new StringBuilder(); sb.append("ssl.quorum.hostnameVerification=false\n"); sb.append("ssl.quorum.clientAuth=NEED\n"); sb.append("ssl.quorum.ciphersuites=").append(String.join(",", new TreeSe...
sb.append("ssl.quorum.protocol=TLSv1.2\n");
private String createTlsQuorumConfig(ZookeeperServerConfig config) { StringBuilder sb = new StringBuilder(); sb.append("ssl.quorum.hostnameVerification=false\n"); sb.append("ssl.quorum.clientAuth=NEED\n"); sb.append("ssl.quorum.ciphersuites=").append(String.join(",", new TreeSe...
class VespaZooKeeperServerImpl extends AbstractComponent implements Runnable, VespaZooKeeperServer { private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(VespaZooKeeperServerImpl.class.getName()); private static final String ZOOKEEPER_JMX_LOG4J_DISABLE = "zookeeper.jmx.log4j.d...
class VespaZooKeeperServerImpl extends AbstractComponent implements Runnable, VespaZooKeeperServer { private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(VespaZooKeeperServerImpl.class.getName()); private static final String ZOOKEEPER_JMX_LOG4J_DISABLE = "zookeeper.jmx.log4j.d...
```suggestion tomlKeyEntryNode.location()), tableArrayChild.location(), tableArrayChild.children()); ```
private void addChildParentArrayToParent(TomlTableNode rootTable, TomlTableArrayNode tableArrayChild) { TomlTableNode parentTable = getParentTable(rootTable, tableArrayChild); List<TomlKeyEntryNode> keys = tableArrayChild.key().keys(); TomlKeyEntryNode tomlKeyEntryNode = keys.get(keys.size() - 1...
getLocationOfKeyEntryList(list)), tableArrayChild.location(), tableArrayChild.children());
private void addChildParentArrayToParent(TomlTableNode rootTable, TomlTableArrayNode tableArrayChild) { TomlTableNode parentTable = getParentTable(rootTable, tableArrayChild); List<TomlKeyEntryNode> keys = tableArrayChild.key().keys(); TomlKeyEntryNode tomlKeyEntryNode = keys.get(keys.size() - 1...
class TomlTransformer extends NodeTransformer<TomlNode> { private DiagnosticLog dlog; public TomlTransformer() { this.dlog = DiagnosticLog.getInstance(); } @Override public TomlNode transform(DocumentNode documentNode) { TomlTableNode rootTable = createRootTable(documentNode); ...
class TomlTransformer extends NodeTransformer<TomlNode> { private DiagnosticLog dlog; public TomlTransformer() { this.dlog = DiagnosticLog.getInstance(); } @Override public TomlNode transform(DocumentNode documentNode) { TomlTableNode rootTable = createRootTable(documentNode); ...
```suggestion "Synthetic bean does not provide a creation method, use ExtendedBeanConfigurator#creator(), ExtendedBeanConfigurator#supplier(), ExtendedBeanConfigurator#createWith() or ExtendedBeanConfigurator#runtimeValue()"); ```
public SyntheticBeanBuildItem done() { if (supplier == null && runtimeValue == null && fun == null && creatorConsumer == null) { throw new IllegalStateException( "Synthetic bean does not provide a creation method, use ExtendedBeanConfigurator } ...
"Synthetic bean does not provide a creation method, use ExtendedBeanConfigurator
public SyntheticBeanBuildItem done() { if (supplier == null && runtimeValue == null && fun == null && creatorConsumer == null) { throw new IllegalStateException( "Synthetic bean does not provide a creation method, use ExtendedBeanConfigurator } ...
class ExtendedBeanConfigurator extends BeanConfiguratorBase<ExtendedBeanConfigurator, Object> { private Supplier<?> supplier; private RuntimeValue<?> runtimeValue; private Function<SyntheticCreationalContext<?>, ?> fun; private boolean staticInit; ExtendedBeanConfigurator(DotNa...
class ExtendedBeanConfigurator extends BeanConfiguratorBase<ExtendedBeanConfigurator, Object> { private Supplier<?> supplier; private RuntimeValue<?> runtimeValue; private Function<SyntheticCreationalContext<?>, ?> fun; private boolean staticInit; ExtendedBeanConfigurator(DotNa...
Hello, I am curious if some work is done on https://issues.apache.org/jira/browse/FLINK-29267 ? I require this solution, I tried to check the files but not sure how can i access connector configurations in PostgresRowConverter file.
protected JdbcSerializationConverter createExternalConverter(LogicalType type) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return (val, index, statement) -> { String valString = val.getString(index).toString(); if (UUI...
if (UUID_REGEX_PATTERN.matcher(valString).matches()) {
protected JdbcSerializationConverter createExternalConverter(LogicalType type) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return (val, index, statement) -> { String valString = val.getString(index).toString(); if (UUI...
class PostgresRowConverter extends AbstractJdbcRowConverter { private static final long serialVersionUID = 1L; private static final Pattern UUID_REGEX_PATTERN = Pattern.compile("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$"); @Override public String converterName() { ...
class PostgresRowConverter extends AbstractJdbcRowConverter { private static final long serialVersionUID = 1L; private static final Pattern UUID_REGEX_PATTERN = Pattern.compile("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$"); @Override public String converterName() { ...
This method is only protected by `readLock`, but you do write operation here. Why not just save the splitted rules in `commonProperties`?
public String[] getSqlBlockRules() { if (this.sqlBlockRulesSplit.length != 0) { return this.sqlBlockRulesSplit; } String sqlBlockRules = commonProperties.getSqlBlockRules(); if (StringUtils.isNotEmpty(sqlBlockRules)) { this.sqlBlockRulesSplit = sqlBlockRules.repla...
String sqlBlockRules = commonProperties.getSqlBlockRules();
public String[] getSqlBlockRules() { return commonProperties.getSqlBlockRulesSplit(); }
class UserProperty implements Writable { private static final String PROP_MAX_USER_CONNECTIONS = "max_user_connections"; private static final String PROP_MAX_QUERY_INSTANCES = "max_query_instances"; private static final String PROP_RESOURCE = "resource"; private static final String PROP_QUOT...
class UserProperty implements Writable { private static final String PROP_MAX_USER_CONNECTIONS = "max_user_connections"; private static final String PROP_MAX_QUERY_INSTANCES = "max_query_instances"; private static final String PROP_RESOURCE = "resource"; private static final String PROP_QUOT...
I think this visitor is useful for us for use cases like this. Rather than checking each expression kind (via syntax kind), this is clean. Is it ok if we use it everywhere?
public static Hover getHover(HoverContext context) { Optional<Document> srcFile = context.currentDocument(); Optional<SemanticModel> semanticModel = context.currentSemanticModel(); if (semanticModel.isEmpty() || srcFile.isEmpty()) { return HoverUtil.getDefaultHoverObject(); }...
MatchedExpressionNodeResolver expressionResolver = new MatchedExpressionNodeResolver(nodeAtCursor);
public static Hover getHover(HoverContext context) { Optional<Document> srcFile = context.currentDocument(); Optional<SemanticModel> semanticModel = context.currentSemanticModel(); if (semanticModel.isEmpty() || srcFile.isEmpty()) { return HoverUtil.getDefaultHoverObject(); }...
class HoverUtil { /** * Get the hover content. * * @param context Hover operation context * @return {@link Hover} Hover content */ private static Hover getHoverForSymbol(Symbol symbol, HoverContext context) { switch (symbol.kind()) { case FUNCTION: ...
class HoverUtil { /** * Get the hover content. * * @param context Hover operation context * @return {@link Hover} Hover content */ private static Hover getHoverForSymbol(Symbol symbol, HoverContext context) { switch (symbol.kind()) { case FUNCTION: ...
Following is from the test case we have added. `BAssertUtil.validateError(resultNeg, i++, "invalid escape sequence '\\\u0000'", 4, 9);` That string is displayed as below in IntelliJ ![Screenshot from 2021-09-13 14-43-53](https://user-images.githubusercontent.com/39232462/133057806-a9dcd175-e46a-4cb7-8d77-616bbc690f1d...
private void processIdentifierEnd() { while (!reader.isEOF()) { int nextChar = reader.peek(); if (isIdentifierFollowingChar(nextChar)) { reader.advance(); continue; } if (nextChar != LexerTerminals.BACKSLASH) { brea...
reportInvalidEscapeSequence((char) 0);
private void processIdentifierEnd() { while (!reader.isEOF()) { int nextChar = reader.peek(); if (isIdentifierFollowingChar(nextChar)) { reader.advance(); continue; } if (nextChar != LexerTerminals.BACKSLASH) { brea...
class BallerinaLexer extends AbstractLexer { public BallerinaLexer(CharReader charReader) { super(charReader, ParserMode.DEFAULT); } /** * Get the next lexical token. * * @return Next lexical token. */ public STToken nextToken() { STToken token; switch (this...
class BallerinaLexer extends AbstractLexer { public BallerinaLexer(CharReader charReader) { super(charReader, ParserMode.DEFAULT); } /** * Get the next lexical token. * * @return Next lexical token. */ public STToken nextToken() { STToken token; switch (this...
I think leaving it here is the cleanest way now that I've looked at the usage again. It needs to eventually be copied to a byte[] in this case so it can be passed over to the native reader.
public static byte[] getPosition(@Nullable ShufflePosition shufflePosition) { if (shufflePosition == null) { return null; } Preconditions.checkArgument(shufflePosition instanceof ByteArrayShufflePosition); ByteArrayShufflePosition adapter = (ByteArrayShufflePosition) shufflePosition; return ad...
return adapter.getPosition().toByteArray();
public static byte[] getPosition(@Nullable ShufflePosition shufflePosition) { if (shufflePosition == null) { return null; } Preconditions.checkArgument(shufflePosition instanceof ByteArrayShufflePosition); ByteArrayShufflePosition adapter = (ByteArrayShufflePosition) shufflePosition; return ad...
class ByteArrayShufflePosition implements Comparable<ShufflePosition>, ShufflePosition { private static final ByteString ZERO = ByteString.copyFrom(new byte[] {0}); private final ByteString position; public ByteArrayShufflePosition(ByteString position) { this.position = position; } public static ByteArr...
class ByteArrayShufflePosition implements Comparable<ShufflePosition>, ShufflePosition { private static final ByteString ZERO = ByteString.copyFrom(new byte[] {0}); private final ByteString position; public ByteArrayShufflePosition(ByteString position) { this.position = position; } public static ByteArr...
Ah ah I thought about it too but decided to not bother you with this but if we are two, let's be picky :). Yeah, it would sure be a nice improvement. Maybe, use a `Set` instead of a `List`. I suppose a `HashSet` would be good enough.
public static RolesAllowedCheck of(String[] allowedRoles) { return CACHE.computeIfAbsent(Arrays.asList(allowedRoles), new Function<List<String>, RolesAllowedCheck>() { @Override public RolesAllowedCheck apply(List<String> allowedRolesList) { return new RolesAllowedCheck(a...
return CACHE.computeIfAbsent(Arrays.asList(allowedRoles), new Function<List<String>, RolesAllowedCheck>() {
public static RolesAllowedCheck of(String[] allowedRoles) { return CACHE.computeIfAbsent(Arrays.asList(allowedRoles), new Function<List<String>, RolesAllowedCheck>() { @Override public RolesAllowedCheck apply(List<String> allowedRolesList) { return new RolesAllowedCheck(a...
class hanging around * for the entire lifecycle of the application */ private static final Map<List<String>, RolesAllowedCheck> CACHE = new ConcurrentHashMap<>(); private final String[] allowedRoles; private RolesAllowedCheck(String[] allowedRoles) { this.allowedRoles = allowedRoles; ...
class hanging around * for the entire lifecycle of the application */ private static final Map<List<String>, RolesAllowedCheck> CACHE = new ConcurrentHashMap<>(); private final String[] allowedRoles; private RolesAllowedCheck(String[] allowedRoles) { this.allowedRoles = allowedRoles; ...
If this step is done only if the `id` and `url` are not null, then the initialization of `username` and `password` variables can be done within the `if` condition.
public void execute(BuildContext buildContext) { CompilerContext context = buildContext.get(BuildContextField.COMPILER_CONTEXT); Manifest manifest = ManifestProcessor.getInstance(context).getManifest(); List<Library> mavenDependencies = new ArrayList<>(); if (manifest.getPlatform().getLi...
if (username != null && password != null) {
public void execute(BuildContext buildContext) { CompilerContext context = buildContext.get(BuildContextField.COMPILER_CONTEXT); Manifest manifest = ManifestProcessor.getInstance(context).getManifest(); List<Library> platformLibs = manifest.getPlatform().getLibraries(); List<Repository> ...
class ResolveMavenDependenciesTask implements Task { @Override }
class ResolveMavenDependenciesTask implements Task { @Override }
```suggestion "JDBC Store configured but '%s' datasource is missing. You can configure your datasource by following the guide available at: https://quarkus.io/guides/datasource", ```
public QuarkusQuartzConnectionPoolProvider() { InstanceHandle<AgroalDataSource> instanceHandle; ArcContainer container = Arc.container(); boolean useDefaultDataSource = "QUARKUS_QUARTZ_DEFAULT_DATASOURCE".equals(dataSourceName); if (useDefaultDataSource) { instanceHandle = co...
"JDBC Store configured but '%s' datasource is missing. You can configure your datasource by following the guide available at: https:
public QuarkusQuartzConnectionPoolProvider() { final ArcContainer container = Arc.container(); final InstanceHandle<AgroalDataSource> instanceHandle; final boolean useDefaultDataSource = "QUARKUS_QUARTZ_DEFAULT_DATASOURCE".equals(dataSourceName); if (useDefaultDataSource) { i...
class QuarkusQuartzConnectionPoolProvider implements PoolingConnectionProvider { private AgroalDataSource dataSource; private static String dataSourceName; @SuppressWarnings("unused") public QuarkusQuartzConnectionPoolProvider(Properties properties) { this(); } @Override publ...
class QuarkusQuartzConnectionPoolProvider implements PoolingConnectionProvider { private AgroalDataSource dataSource; private static String dataSourceName; @Override public DataSource getDataSource() { return dataSource; } @Override public Connection getConnection() throws SQ...
I don't think this it's reasonable.
public Operator(OperatorType opType) { this.opType = opType; }
this.opType = opType;
public Operator(OperatorType opType) { this.opType = opType; }
class Operator { public static final long DEFAULT_LIMIT = -1; public static final long DEFAULT_OFFSET = 0; protected final OperatorType opType; protected long limit = DEFAULT_LIMIT; protected ScalarOperator predicate = null; private static long saltGenerator = 0; /** * Before entering...
class Operator { public static final long DEFAULT_LIMIT = -1; public static final long DEFAULT_OFFSET = 0; protected final OperatorType opType; protected long limit = DEFAULT_LIMIT; protected ScalarOperator predicate = null; private static long saltGenerator = 0; /** * Before entering...
Yeah. For Java 11 there is no "JRE" - the only distribution for Java is the JDK. The containers that we provide have the Java 11 JDK. For Java 8, there is a development distribution, and a runtime distribution (JRE). For the containers we provide the JRE.
public static DataflowRunner fromOptions(PipelineOptions options) { DataflowPipelineOptions dataflowOptions = PipelineOptionsValidator.validate(DataflowPipelineOptions.class, options); ArrayList<String> missing = new ArrayList<>(); if (dataflowOptions.getAppName() == null) { missing.add("appN...
String userAgent =
public static DataflowRunner fromOptions(PipelineOptions options) { DataflowPipelineOptions dataflowOptions = PipelineOptionsValidator.validate(DataflowPipelineOptions.class, options); ArrayList<String> missing = new ArrayList<>(); if (dataflowOptions.getAppName() == null) { missing.add("appN...
class path allowing for * user specified configuration injection into the ObjectMapper. This supports user custom types * on {@link PipelineOptions}
class path allowing for * user specified configuration injection into the ObjectMapper. This supports user custom types * on {@link PipelineOptions}
Is it correct that this error is getting logged? Only `Context` is an unknown type here, right? Even though there are errors when attempting to resolve `FunctionEntry`'s members, it is not unknown?
public void testFunctionPointerAsVariable() { CompileResult result = BCompileUtil.compile("test-src/expressions/lambda/negative/fp-type-mismatch1-negative.bal"); Assert.assertEquals(result.getErrorCount(), 3); BAssertUtil.validateError(result, 0, "incompatible types: expected 'fu...
BAssertUtil.validateError(result, 2, "unknown type 'FunctionEntry'", 12, 5);
public void testFunctionPointerAsVariable() { CompileResult result = BCompileUtil.compile("test-src/expressions/lambda/negative/fp-type-mismatch1-negative.bal"); Assert.assertEquals(result.getErrorCount(), 3); BAssertUtil.validateError(result, 0, "incompatible types: expected 'fu...
class FunctionPointersNegativeTest { @Test() @Test() public void testLambdaAsVariable() { CompileResult result = BCompileUtil.compile("test-src/expressions/lambda/negative/fp-type-mismatch2-negative.bal"); Assert.assertEquals(result.getErrorCount(), 1); BAssert...
class FunctionPointersNegativeTest { @Test() @Test() public void testLambdaAsVariable() { CompileResult result = BCompileUtil.compile("test-src/expressions/lambda/negative/fp-type-mismatch2-negative.bal"); Assert.assertEquals(result.getErrorCount(), 1); BAssert...
nit: I find the happen before/after confusing since they may happen whenever we are just blocking on them completing here Maybe Block on completing the past closes before returning. We do so after starting the current closes in the background so that they can happen in parallel.
public void processElement(ProcessContext c, BoundedWindow window) throws Exception { getDynamicDestinations().setSideInputAccessorFromProcessContext(c); Map<DestinationT, Writer<DestinationT, OutputT>> writers = Maps.newHashMap(); for (UserT input : c.element().getValue()) { ...
public void processElement(ProcessContext c, BoundedWindow window) throws Exception { getDynamicDestinations().setSideInputAccessorFromProcessContext(c); PaneInfo paneInfo = c.pane(); DestinationT destination = getDynamicDestinations().getDestination(c.element()); ...
class WriteUnshardedTempFilesFn extends DoFn<UserT, FileResult<DestinationT>> { private final @Nullable TupleTag<KV<ShardedKey<Integer>, UserT>> unwrittenRecordsTag; private final Coder<DestinationT> destinationCoder; private @Nullable Map<WriterKey<DestinationT>, Writer<DestinationT, OutputT>> writer...
class WriteUnshardedTempFilesFn extends DoFn<UserT, FileResult<DestinationT>> { private final @Nullable TupleTag<KV<ShardedKey<Integer>, UserT>> unwrittenRecordsTag; private final Coder<DestinationT> destinationCoder; private @Nullable Map<WriterKey<DestinationT>, Writer<DestinationT, OutputT>> writer...
Nit: please add blank line between line 94 and 95. Nit2: add space before "cast" Maybe let's drop the ": Beam incubation date :)" part (imo, it may be distractive and it's redundant)
public void testSavePerfsToBigQuery() throws IOException, InterruptedException { NexmarkConfiguration nexmarkConfiguration1 = new NexmarkConfiguration(); nexmarkConfiguration1.query = QUERY; nexmarkConfiguration1.cpuDelayMs = 100L; NexmarkPerf nexmarkPerf1 = new NexmarkPerf(); nexmarkPerf1.numR...
public void testSavePerfsToBigQuery() throws IOException, InterruptedException { NexmarkConfiguration nexmarkConfiguration1 = new NexmarkConfiguration(); nexmarkConfiguration1.query = QUERY; nexmarkConfiguration1.cpuDelayMs = 100L; NexmarkPerf nexmarkPerf1 = new NexmarkPerf(); nexmarkPerf1.numR...
class PerfsToBigQueryTest { private static final int QUERY = 1; private NexmarkOptions options; private FakeDatasetService fakeDatasetService = new FakeDatasetService(); private FakeJobService fakeJobService = new FakeJobService(); private FakeBigQueryServices fakeBqServices = new FakeBigQueryServices(...
class PerfsToBigQueryTest { private static final int QUERY = 1; private NexmarkOptions options; private FakeDatasetService fakeDatasetService = new FakeDatasetService(); private FakeJobService fakeJobService = new FakeJobService(); private FakeBigQueryServices fakeBqServices = new FakeBigQueryServices(...
Could we preserve this existing line case. just add one more line to test `*||**|`, like ``` // complete delimiter "Whether 'tis nobler in the mind to suffer |*", // edge case: partial delimiter then complete delimiter "The slings and arrows of outrageous fortune,*||**|" // truncated delimiter "Or to take arms against ...
public void testReadStringsWithCustomDelimiter() throws Exception { final String[] inputStrings = new String[] { "To be, or not to be: that |is the question: ", "To be, or not to be: that *is the question: ", "Whether 'tis nobler...
"Whether 'tis nobler in the mind to suffer *||**|",
public void testReadStringsWithCustomDelimiter() throws Exception { final String[] inputStrings = new String[] { "To be, or not to be: that |is the question: ", "To be, or not to be: that *is the question: ", "Whether 'tis nobler...
class BasicIOTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Rule public TestPipeline p = TestPipeline.create(); private void runTestRead(String[] expected) throws Exception { File tmpFile = tempFolder.newFile(); String filename = tmpFile.getPath(); try (PrintStr...
class BasicIOTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Rule public TestPipeline p = TestPipeline.create(); private void runTestRead(String[] expected) throws Exception { File tmpFile = tempFolder.newFile(); String filename = tmpFile.getPath(); try (PrintStr...
Shall we create an issue for this?
private boolean checkFillerValue(BUnionType type) { if (type.isNullable()) { return true; } Iterator<BType> iterator = type.getMemberTypes().iterator(); BType firstMember = iterator.next(); while (iterator.hasNext()) { if (!isSameType(firstMember, iterator...
return isValueType(firstMember) && hasFillerValue(firstMember);
private boolean checkFillerValue(BUnionType type) { if (type.isNullable()) { return true; } Iterator<BType> iterator = type.getMemberTypes().iterator(); BType firstMember = iterator.next(); while (iterator.hasNext()) { if (!isSameType(firstMember, iterator...
class TypePair { BType sourceType; BType targetType; public TypePair(BType sourceType, BType targetType) { this.sourceType = sourceType; this.targetType = targetType; } @Override public boolean equals(Object obj) { if (!(obj instanceo...
class TypePair { BType sourceType; BType targetType; public TypePair(BType sourceType, BType targetType) { this.sourceType = sourceType; this.targetType = targetType; } @Override public boolean equals(Object obj) { if (!(obj instanceo...
It feels inconsistent that the OperatorContext and the internal of taskInfo are given to the `DefaultRuntimeContext` at the same time. I think we either pass the operatorContext that contains all the info or we just pass the required info from the operator context. Same for the other operators.
public void open() throws Exception { super.open(); StreamingRuntimeContext operatorContext = getRuntimeContext(); TaskInfo taskInfo = operatorContext.getTaskInfo(); context = new DefaultRuntimeContext( operatorContext, task...
operatorContext,
public void open() throws Exception { super.open(); StreamingRuntimeContext operatorContext = getRuntimeContext(); TaskInfo taskInfo = operatorContext.getTaskInfo(); context = new DefaultRuntimeContext( operatorContext.getJobInfo().getJobName(), ...
class ProcessOperator<IN, OUT> extends AbstractUdfStreamOperator<OUT, OneInputStreamProcessFunction<IN, OUT>> implements OneInputStreamOperator<IN, OUT>, BoundedOneInput { protected transient DefaultRuntimeContext context; protected transient DefaultPartitionedContext partitionedContext; ...
class ProcessOperator<IN, OUT> extends AbstractUdfStreamOperator<OUT, OneInputStreamProcessFunction<IN, OUT>> implements OneInputStreamOperator<IN, OUT>, BoundedOneInput { protected transient DefaultRuntimeContext context; protected transient DefaultPartitionedContext partitionedContext; ...
Where will the key ID come from when this has rolled out?
private String corePublicKeyFlagValue(NodeAgentContext context) { return coreEncryptionPublicKeyIdFlag.with(FetchVector.Dimension.NODE_TYPE, context.nodeType().name()).value(); }
return coreEncryptionPublicKeyIdFlag.with(FetchVector.Dimension.NODE_TYPE, context.nodeType().name()).value();
private String corePublicKeyFlagValue(NodeAgentContext context) { return coreEncryptionPublicKeyIdFlag.with(FetchVector.Dimension.NODE_TYPE, context.nodeType().name()).value(); }
class CoredumpHandler { private static final Pattern HS_ERR_PATTERN = Pattern.compile("hs_err_pid[0-9]+\\.log"); private static final String PROCESSING_DIRECTORY_NAME = "processing"; private static final String METADATA_FILE_NAME = "metadata.json"; private static final String METADATA2_FILE_NAME = "met...
class CoredumpHandler { private static final Pattern HS_ERR_PATTERN = Pattern.compile("hs_err_pid[0-9]+\\.log"); private static final String PROCESSING_DIRECTORY_NAME = "processing"; private static final String METADATA_FILE_NAME = "metadata.json"; private static final String METADATA2_FILE_NAME = "met...
Sorry, I was not clear enough. I meant we don't need to test `sequence(SpecificInputTypeStrategies.ARRAY_COMPARABLE)` takes a single argument. We don't need to test that, because that's a property of the `sequence`, whatever we use here instead of `SpecificInputTypeStrategies.ARRAY_COMPARABLE` does not really matter. ...
protected Stream<TestSpec> testData() { return Stream.of( TestSpec.forStrategy(WILDCARD) .calledWithArgumentTypes(DataTypes.INT(), DataTypes.INT()) .expectSignature("f(*)") .expectArgumentTypes(DataTypes.INT...
+ "f(<ARRAY<COMPARABLE>>)"),
protected Stream<TestSpec> testData() { return Stream.of( TestSpec.forStrategy(WILDCARD) .calledWithArgumentTypes(DataTypes.INT(), DataTypes.INT()) .expectSignature("f(*)") .expectArgumentTypes(DataTypes.INT...
class InputTypeStrategiesTest extends InputTypeStrategiesTestBase { @Override private static DataType timeIndicatorType(TimestampKind timestampKind) { return TypeConversions.fromLogicalToDataType( new LocalZonedTimestampType(false, timestampKind, 3)); } /** Simple pojo th...
class InputTypeStrategiesTest extends InputTypeStrategiesTestBase { @Override private static DataType timeIndicatorType(TimestampKind timestampKind) { return TypeConversions.fromLogicalToDataType( new LocalZonedTimestampType(false, timestampKind, 3)); } /** Simple pojo th...
No, this method is simply checking whether the list of media items provided by the user via the ACCEPT header is supported. The method that was using reflection was removed from this util.
private Response buildViolationReportResponse(ConstraintViolationException cve) { Status status = Status.BAD_REQUEST; Response.ResponseBuilder builder = Response.status(status); builder.header(Validation.VALIDATION_HEADER, "true"); MediaType mediaType = ValidatorMediaTypeUtil.g...
MediaType mediaType = ValidatorMediaTypeUtil.getAcceptMediaTypeFromSupported(headers.getAcceptableMediaTypes());
private Response buildViolationReportResponse(ConstraintViolationException cve) { Status status = Status.BAD_REQUEST; Response.ResponseBuilder builder = Response.status(status); builder.header(Validation.VALIDATION_HEADER, "true"); MediaType mediaType = ValidatorMediaTypeUtil.g...
class ResteasyReactiveViolationExceptionMapper implements ExceptionMapper<ValidationException> { @Context HttpHeaders headers; @Override public Response toResponse(ValidationException exception) { if (!(exception instanceof ResteasyReactiveViolationException)) { ...
class ResteasyReactiveViolationExceptionMapper implements ExceptionMapper<ValidationException> { @Context HttpHeaders headers; @Override public Response toResponse(ValidationException exception) { if (!(exception instanceof ResteasyReactiveViolationException)) { ...
Added a synchronized lock in SparkEtlHandler for cluster id. Now initRepository operations are protected by lock if they are in same cluster
private void initRepository() throws LoadException { LOG.info("start to init remote repository"); boolean needUpload = false; boolean needReplace = false; CHECK: { if (Strings.isNullOrEmpty(remoteRepositoryPath) || brokerDesc == null) { break CHECK; ...
LOG.info("start to init remote repository");
private void initRepository() throws LoadException { LOG.info("start to init remote repository"); boolean needUpload = false; boolean needReplace = false; CHECK: { if (Strings.isNullOrEmpty(remoteRepositoryPath) || brokerDesc == null) { break CHECK; ...
class SparkRepository { private static final Logger LOG = LogManager.getLogger(SparkRepository.class); public static final String REPOSITORY_DIR = "__spark_repository__"; public static final String PREFIX_ARCHIVE = "__archive_"; public static final String PREFIX_LIB = "__lib_"; public static final ...
class SparkRepository { private static final Logger LOG = LogManager.getLogger(SparkRepository.class); public static final String REPOSITORY_DIR = "__spark_repository__"; public static final String PREFIX_ARCHIVE = "__archive_"; public static final String PREFIX_LIB = "__lib_"; public static final ...
`testFile` starts context with `TOP_LEVEL_NODE`. Let's add the codes inside a function
public void testIntermediateClauseStartRecovery() { testFile("query-expr/query_expr_source_68.bal", "query-expr/query_expr_assert_68.json"); }
testFile("query-expr/query_expr_source_68.bal", "query-expr/query_expr_assert_68.json");
public void testIntermediateClauseStartRecovery() { testFile("query-expr/query_expr_source_68.bal", "query-expr/query_expr_assert_68.json"); }
class QueryExpressionTest extends AbstractExpressionsTest { @Test public void testSimplestQuery() { test("from int a in b select c", "query-expr/query_expr_assert_01.json"); } @Test public void testQueryWithFromIntermediateClause() { test("from int a in b from int c in d sele...
class QueryExpressionTest extends AbstractExpressionsTest { @Test public void testSimplestQuery() { test("from int a in b select c", "query-expr/query_expr_assert_01.json"); } @Test public void testQueryWithFromIntermediateClause() { test("from int a in b from int c in d sele...
I think I see why this was done, because you need the metric when the KV states are registered. But can't we just create the metric in this class if required, after the DB was opened? then the builder can get the metrics with a getter before passing it into the `RocksDBKeyedStateBackend`.
public void openDB() throws IOException { db = RocksDBOperationUtils.openDB(dbPath, columnFamilyDescriptors, columnFamilyHandles, columnOptions, dbOptions); defaultColumnFamilyHandle = columnFamilyHandles.remove(0); if (nativeMetricMonitor != null) { nativeMetricMonitor.setRocksDB(db); } }
nativeMetricMonitor.setRocksDB(db);
public void openDB() throws IOException { db = RocksDBOperationUtils.openDB( dbPath, columnFamilyDescriptors, columnFamilyHandles, RocksDBOperationUtils.createColumnFamilyOptions(columnFamilyOptionsFactory, "default"), dbOptions); defaultColumnFamilyHandle = columnFamilyHandles.remove(0); nat...
class AbstractRocksDBRestoreOperation<K> implements RocksDBRestoreOperation, AutoCloseable { protected final KeyGroupRange keyGroupRange; protected final int keyGroupPrefixBytes; protected final int numberOfTransferringThreads; protected final CloseableRegistry cancelStreamRegistry; protected final ClassLoader use...
class AbstractRocksDBRestoreOperation<K> implements RocksDBRestoreOperation, AutoCloseable { protected final KeyGroupRange keyGroupRange; protected final int keyGroupPrefixBytes; protected final int numberOfTransferringThreads; protected final CloseableRegistry cancelStreamRegistry; protected final ClassLoader use...
Shall we move/merge this line with 103?
public void execute() { if (helpFlag) { String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(parentCmdParser, "build"); outStream.println(commandUsageInfo); return; } if (argList != null && argList.size() > 1) { throw LauncherUtils.createUsa...
!RepoUtils.hasProjectRepo(currentDir)) {
public void execute() { if (helpFlag) { String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(parentCmdParser, "build"); outStream.println(commandUsageInfo); return; } if (argList != null && argList.size() > 1) { throw LauncherUtils.createUsa...
class BuildCommand implements BLauncherCmd { private static final String USER_DIR = "user.dir"; private static PrintStream outStream = System.err; private JCommander parentCmdParser; @Parameter(names = {"-c"}, description = "build a compiled package") private boolean buildCompiledPkg; @Parame...
class BuildCommand implements BLauncherCmd { private static final String USER_DIR = "user.dir"; private static PrintStream outStream = System.err; private JCommander parentCmdParser; @Parameter(names = {"-c"}, description = "build a compiled package") private boolean buildCompiledPkg; @Parame...
Fixed and a test case added.
private STNode parseTableConstructorExpr(SyntaxKind nextTokenKind, STNode tableKeyword, STNode keySpecifier) { STNode openBracket; STNode rowList; STNode closeBracket; if (nextTokenKind == SyntaxKind.KEY_KEYWORD) { keySpecifier = parseKeySpecifier(); nex...
switch (nextTokenKind) {
private STNode parseTableConstructorExpr(SyntaxKind nextTokenKind, STNode tableKeyword, STNode keySpecifier) { STNode openBracket; STNode rowList; STNode closeBracket; switch (nextTokenKind) { case KEY_KEYWORD: keySpecifier = parseKeySpecifier(); ...
class BallerinaParser { private static final OperatorPrecedence DEFAULT_OP_PRECEDENCE = OperatorPrecedence.ACTION; private final BallerinaParserErrorHandler errorHandler; private final AbstractTokenReader tokenReader; private ParserRuleContext currentParamKind = ParserRuleContext.REQUIRED_PARAM; ...
class BallerinaParser { private static final OperatorPrecedence DEFAULT_OP_PRECEDENCE = OperatorPrecedence.ACTION; private final BallerinaParserErrorHandler errorHandler; private final AbstractTokenReader tokenReader; private ParserRuleContext currentParamKind = ParserRuleContext.REQUIRED_PARAM; ...
```suggestion } if (symbol.restParam != null) { ``` Shouldn't there be a new line here?
private BInvokableSymbol resolveInvokableSymbol(BInvokableSymbol symbol, BType newInvokableType, BType boundType) { BInvokableSymbol newInvokableSymbol = duplicateSymbol(symbol); newInvokableSymbol.type = newInvokableType; for (BVarSymbol param : symbol.params) { BType newParamType ...
newInvokableSymbol.params.add(newVarSymbol);
private BInvokableSymbol resolveInvokableSymbol(BInvokableSymbol symbol, BType newInvokableType, BType boundType) { BInvokableSymbol newInvokableSymbol = duplicateSymbol(symbol); newInvokableSymbol.type = newInvokableType; for (BVarSymbol param : symbol.params) { BType newParamType ...
class TypeParamResolver implements BTypeVisitor<BType, BType> { private final Map<BType, BType> boundTypes = new HashMap<>(); private final BType typeParam; public TypeParamResolver(BType typeParam) { this.typeParam = typeParam; } /** * Given a type containing a type param component,...
class TypeParamResolver implements BTypeVisitor<BType, BType> { private final Map<BType, BType> boundTypes = new HashMap<>(); private final BType typeParam; public TypeParamResolver(BType typeParam) { this.typeParam = typeParam; } /** * Given a type containing a type param component,...
Doesn't this mean that a given deployment will send one request per host in the node repository to the orchestrator? In larger zones that is ~400.
public boolean canAllocateTenantNodeTo(Node host, boolean dynamicProvisioning) { if ( ! host.type().canRun(NodeType.tenant)) return false; if (host.status().wantToRetire()) return false; if (host.allocation().map(alloc -> alloc.membership().retired()).orElse(false)) return false; if (sus...
if (suspended(host)) return false;
public boolean canAllocateTenantNodeTo(Node host, boolean dynamicProvisioning) { if ( ! host.type().canRun(NodeType.tenant)) return false; if (host.status().wantToRetire()) return false; if (host.allocation().map(alloc -> alloc.membership().retired()).orElse(false)) return false; if (sus...
class Nodes { private static final Logger log = Logger.getLogger(Nodes.class.getName()); private final CuratorDatabaseClient db; private final Zone zone; private final Clock clock; private final Orchestrator orchestrator; public Nodes(CuratorDatabaseClient db, Zone zone, Clock clock, Orchestr...
class Nodes { private static final Logger log = Logger.getLogger(Nodes.class.getName()); private final CuratorDatabaseClient db; private final Zone zone; private final Clock clock; private final Orchestrator orchestrator; public Nodes(CuratorDatabaseClient db, Zone zone, Clock clock, Orchestr...