method2testcases
stringlengths
118
6.63k
### Question: ResendFailedMessageServiceBeanDefinitionFactory { public AbstractBeanDefinition create(String brokerName, String messageSenderBeanName) { return genericBeanDefinition(ResendFailedMessageService.class) .addConstructorArgValue(brokerName) .addConstructorArgReference("failedMessageSearchService") .addConstru...
### Question: ResendFailedMessageServiceBeanDefinitionFactory { public String createBeanName(String brokerName) { return RESEND_FAILED_MESSAGE_SERVICE_BEAN_NAME_PREFIX + brokerName; } ResendFailedMessageServiceBeanDefinitionFactory(HistoricStatusPredicate historicStatusPredicate); AbstractBeanDefinition create(String b...
### Question: ResendFailedMessageService { public void resendMessages() { LOGGER.debug("Resending FailedMessages to: {}", brokerName); failedMessageSearchService .search(searchMatchingAllCriteria() .withBroker(brokerName) .withStatus(RESENDING) .build()) .stream() .filter(historicStatusPredicate::test) .forEach(message...
### Question: VaultApiFactory { Vault createVaultAPI(VaultProperties vaultProperties) throws VaultException { return new Vault(buildConfiguration(vaultProperties)); } }### Answer: @Test public void throwsExceptionWhenTokenFileNotFound() throws Exception { VaultProperties vaultProperties = createVaultPropertiesWithTo...
### Question: FailedMessageId implements Id { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return id.equals(((FailedMessageId) o).id); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMess...
### Question: SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public boolean matches(String secret) { return isVaultEnabledAndPatternMatches(secret); } SingleValueVaultLookupStrategy(VaultProperties vaultProperties, VaultApiFactory vaultApiFactory); @Override boolean matches(Str...
### Question: SingleValueVaultLookupStrategy implements SensitiveConfigValueLookupStrategy { @Override public DecryptedValue retrieveSecret(String secretPath) { Matcher matcher = PATTERN.matcher(secretPath); if (matcher.matches()) { String vaultPath = matcher.group(1); try { String value = vaultAPI().logical().read(vau...
### Question: SensitiveConfigValueLookupRegistry { public DecryptedValue retrieveSecret(String secretPath) { return resolutionStrategies .stream() .filter(service -> service.matches(secretPath)) .findFirst() .map(service -> service.retrieveSecret(secretPath)) .orElseThrow(() -> new IllegalArgumentException("No relevant...
### Question: VaultPropertySource extends MapPropertySource { @Override public char[] getProperty(String name) { if (containsProperty(name)) { LOGGER.trace("Attempting to lookup property key = {}", name); return sensitiveConfigValueLookupRegistry.retrieveSecret(super.getProperty(name).toString()).getClearText(); } retu...
### Question: FailedMessageId implements Id { @Override public int hashCode() { return id.hashCode(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Overri...
### Question: FailedMessageBuilderFactory { public FailedMessageBuilder create(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(IS_DELETED.negate()) .map(createFailedMessageBuilder()) .orElseThrow(failedMessageNotFound(failedMessageId)) .withUpdateRequestAdapterRegistry(updat...
### Question: FailedMessageLabelService { public void addLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Adding label '{}' to FailedMessage: {}", label, failedMessageId); failedMessageDao.addLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void addLabel...
### Question: FailedMessageLabelService { public void removeLabel(FailedMessageId failedMessageId, String label) { LOGGER.debug("Removing label '{}' from FailedMessage: {}", label, failedMessageId); failedMessageDao.removeLabel(failedMessageId, label); } FailedMessageLabelService(FailedMessageDao failedMessageDao); voi...
### Question: FailedMessageLabelService { public void setLabels(FailedMessageId failedMessageId, Set<String> labels) { LOGGER.debug("Replacing all labels on FailedMessage: {}", failedMessageId); failedMessageDao.setLabels(failedMessageId, labels); } FailedMessageLabelService(FailedMessageDao failedMessageDao); void add...
### Question: FailedMessageService { public void create(FailedMessage failedMessage) { failedMessageDao.insert(failedMessage); } FailedMessageService(FailedMessageDao failedMessageDao, FailedMessageBuilderFactory failedMessageBuilderFactory); void create(FailedMessage failedMessage); voi...
### Question: FailedMessageService { public <T extends UpdateRequest> void update(FailedMessageId failedMessageId, T updateRequest) { update(failedMessageId, Collections.singletonList(updateRequest)); } FailedMessageService(FailedMessageDao failedMessageDao, FailedMessageBuilderFactory f...
### Question: PredicateOutcomeFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { if (predicate.test(failedMessage)) { positiveOutcomeFailedMessageProcessor.process(failedMessage); } else { negativeOutcomeFailedMessageProcessor.process(failedMessage); ...
### Question: FailedMessageId implements Id { @Override public String toString() { return id.toString(); } private FailedMessageId(UUID id); static FailedMessageId newFailedMessageId(); static FailedMessageId fromUUID(UUID uuid); @JsonCreator static FailedMessageId fromString(String uuid); @Override UUID getId(); @Ove...
### Question: NewFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageService.create(failedMessage); } NewFailedMessageProcessor(FailedMessageService failedMessageService); @Override void process(FailedMessage failedMessage); }### Answer: ...
### Question: UniqueFailedMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return !failedMessageDao.findById(failedMessage.getFailedMessageId()).isPresent(); } UniqueFailedMessageIdPredicate(FailedMessageDao failedMessageDao); @Override boolean test(F...
### Question: ExistingFailedMessageProcessor implements FailedMessageProcessor { @Override public void process(FailedMessage failedMessage) { failedMessageDao.update(failedMessage); } ExistingFailedMessageProcessor(FailedMessageDao failedMessageDao); @Override void process(FailedMessage failedMessage); }### Answer: @T...
### Question: UniqueJmsMessageIdPredicate implements Predicate<FailedMessage> { @Override public boolean test(FailedMessage failedMessage) { return failedMessageSearchService.search(searchMatchingAllCriteria() .withBroker(failedMessage.getDestination().getBrokerName()) .withJmsMessageId(failedMessage.getJmsMessageId())...
### Question: PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public Map<String, Object> convertToObject(String value) { if (value == null) { return Collections.emptyMap(); } try { return objectMapper.readValue(value, new TypeReference<Map<String, Object>>() {}); } catch (IOExcep...
### Question: PropertiesConverter implements ObjectConverter<Map<String, Object>, String> { @Override public String convertFromObject(Map<String, Object> item) { if (item == null) { return null; } try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { LOGGER.error("Could not convert t...
### Question: InstantAsDateTimeCodec implements Codec<Instant> { @Override public void encode(BsonWriter writer, Instant value, EncoderContext encoderContext) { writer.writeDateTime(value.toEpochMilli()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode...
### Question: StatusHistoryResponse { public StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus status, @JsonProperty("effectiveDateTime") Instant effectiveDateTime) { this.status = status; this.effectiveDateTime = effectiveDateTime; } StatusHistoryResponse(@JsonProperty("status") FailedMessageStatus sta...
### Question: CreateFailedMessageRequest { CreateFailedMessageRequest(@JsonProperty("failedMessageId") FailedMessageId failedMessageId, @JsonProperty("brokerName") String brokerName, @JsonProperty("destinationName") String destination, @JsonProperty("sentAt") Instant sentAt, @JsonProperty("failedAt") Instant failedAt, ...
### Question: SearchFailedMessageRequest { public static SearchFailedMessageRequestBuilder searchMatchingAllCriteria() { return new SearchFailedMessageRequestBuilder(AND); } private SearchFailedMessageRequest(@JsonProperty("broker") Optional<String> broker, @JsonProperty("destina...
### Question: RemoveFailedMessageService { public void removeFailedMessages() { try { logger.info("Attempting to remove FailedMessages"); final long count = failedMessageDao.removeFailedMessages(); logger.info("Successfully removed {} messages", count); } catch (Exception e) { logger.error("Could not remove messages", ...
### Question: InstantAsDateTimeCodec implements Codec<Instant> { @Override public Instant decode(BsonReader reader, DecoderContext decoderContext) { return Instant.ofEpochMilli(reader.readDateTime()); } @Override void encode(BsonWriter writer, Instant value, EncoderContext encoderContext); @Override Instant decode(Bso...
### Question: ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessage(FailedMessageId failedMessageId) { failedMessageService.update(failedMessageId, statusUpdateRequest(RESEND)); } ResendFailedMessageResource(FailedMessageService failedMessageService, ...
### Question: ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); } ResendFailedMessag...
### Question: FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = fai...
### Question: CreateFailedMessageResource implements CreateFailedMessageClient { public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); } CreateFailedMessageResource(FailedMessageFactory failedMessageFactory, FailedMessageDao fai...
### Question: FailedMessageFactory { public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDest...
### Question: FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFac...
### Question: RemoveRecordsQueryFactory { public Document create() { return new Document() .append(STATUS_HISTORY + ".0." + STATUS, DELETED.name()) .append(STATUS_HISTORY + ".0." + EFFECTIVE_DATE_TIME, new Document(QueryOperators.LT, now().minus(7, DAYS))); } Document create(); }### Answer: @Test public void removeRe...
### Question: FailedMessageSearchResource implements SearchFailedMessageClient { @Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toLi...
### Question: UpdateFailedMessageResource implements UpdateFailedMessageClient { @Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); } UpdateFailedMessageResou...
### Question: MessageTextExtractor { public String extractText(Message message) { if (message instanceof TextMessage) { TextMessage textMessage = (TextMessage) message; try { return textMessage.getText(); } catch (JMSException e) { String errorMsg = String.format("Failed to extract the text from TextMessage: %s", textM...
### Question: FailedMessageTransformer implements JmsMessageTransformer<TextMessage, FailedMessage> { @Override public void transform(TextMessage textMessage, FailedMessage data) throws JMSException { textMessage.setText(data.getContent()); Map<String, Object> properties = data.getProperties(); properties.keySet().forE...
### Question: FailedMessageListener implements MessageListener { @Override public void onMessage(Message message) { try { LOGGER.debug("Received message: {} with CorrelationId: {}", message.getJMSMessageID(), message.getJMSCorrelationID()); failedMessageProcessor.process(failedMessageFactory.createFailedMessage(message...
### Question: FailedMessageConverter implements DocumentWithIdConverter<FailedMessage, FailedMessageId> { @Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); } FailedMessageConverter(DocumentConverter<Destination> destinationDocumentConve...
### Question: CircularBuffer { public int size() { return currentSize; } CircularBuffer(int size); void enqueue(T item); int size(); @SuppressWarnings("unchecked") T getItem(int index); }### Answer: @Test public void size() { CircularBuffer<Integer> queue = new CircularBuffer<>(2); assertEquals(0, queue.size()); queue...
### Question: CircularBuffer { @SuppressWarnings("unchecked") public T getItem(int index) { int target = head - index; if (target < 0) target = queue.length + target; return (T) queue[target]; } CircularBuffer(int size); void enqueue(T item); int size(); @SuppressWarnings("unchecked") T getItem(int index); }### Answer...
### Question: KubeCloudInstanceImpl implements KubeCloudInstance { @NotNull @Override public Date getStartedTime() { final PodStatus podStatus = myPod.getStatus(); if(podStatus == null) return myCreationTime; try { final List<PodCondition> podConditions = podStatus.getConditions(); if (podConditions != null && !podCond...
### Question: KubeCloudClient implements CloudClientEx { @Override public boolean isInitialized() { return true; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNul...
### Question: BoltOptions implements AutoCloseable { @Override public void close() { BoltNative.BoltDBOptions_Free(objectId); } BoltOptions(); BoltOptions(long timeout); BoltOptions(long timeout, boolean noGrowSync, boolean readOnly, int mmapFlags, int initialMmapSize); @Override void close(); }### Answer: @Test pub...
### Question: BoltBucket implements AutoCloseable { public void delete(byte[] key) { Error.ByValue error = BoltNative.BoltDBBucket_Delete(objectId, key, key.length); error.checkError(); } BoltBucket(long objectId); @Override void close(); byte[] get(byte[] key); void put(byte[] key, byte[] value); void delete(byte[] ke...
### Question: BoltBucket implements AutoCloseable { public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBBucket_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } BoltBucket(long objectId); @Override void close(); byte[] get(byte[]...
### Question: BoltTransaction { public void commit() { Error.ByValue error = BoltNative.BoltDBTransaction_Commit(objectId); error.checkError(); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(...
### Question: BoltTransaction { public void rollback() { Error.ByValue error = BoltNative.BoltDBTransaction_Rollback(objectId); error.checkError(); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExi...
### Question: BoltTransaction { public int getId() { return BoltNative.BoltDBTransaction_GetId(objectId); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[]...
### Question: BoltTransaction { public long getDatabaseSize() { return BoltNative.BoltDBTransaction_Size(objectId); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBuc...
### Question: BoltTransaction { public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long g...
### Question: BoltCursor implements AutoCloseable { public BoltKeyValue first() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_First(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } } BoltCursor(long objectId); @Override void close(); BoltKeyValu...
### Question: BoltTransaction { public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } BoltTransaction(long objectId); void commit(); void rollback(...
### Question: BoltTransaction { public void deleteBucket(byte[] name) { Error.ByValue error = BoltNative.BoltDBTransaction_DeleteBucket(objectId, name, name.length); error.checkError(); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] ...
### Question: BoltTransaction { public BoltBucket getBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_Bucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabas...
### Question: BoltTransaction { public BoltCursor createCursor() { long cursorObjectId = BoltNative.BoltDBTransaction_Cursor(objectId); return new BoltCursor(cursorObjectId); } BoltTransaction(long objectId); void commit(); void rollback(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); Bolt...
### Question: Bolt implements AutoCloseable { public void close() { BoltNative.BoltDB_Close(objectId); } Bolt(String databaseFileName); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); void close(); BoltTransaction begin...
### Question: Bolt implements AutoCloseable { public void update(Consumer<BoltTransaction> callback) { BoltTransaction transaction = begin(true); try { callback.accept(transaction); transaction.commit(); } catch (Throwable ex) { transaction.rollback(); throw ex; } } Bolt(String databaseFileName); Bolt(String databaseF...
### Question: Bolt implements AutoCloseable { public void view(Consumer<BoltTransaction> callback) { BoltTransaction transaction = begin(false); try { callback.accept(transaction); } finally { transaction.rollback(); } } Bolt(String databaseFileName); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode); Bol...
### Question: BoltCursor implements AutoCloseable { public BoltKeyValue last() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Last(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } } BoltCursor(long objectId); @Override void close(); BoltKeyValue ...
### Question: BoltCursor implements AutoCloseable { public BoltKeyValue next() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Next(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } } BoltCursor(long objectId); @Override void close(); BoltKeyValue ...
### Question: BoltCursor implements AutoCloseable { public BoltKeyValue prev() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Prev(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } } BoltCursor(long objectId); @Override void close(); BoltKeyValue ...
### Question: BoltCursor implements AutoCloseable { public BoltKeyValue seek(byte[] seek) { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Seek(objectId, seek, seek.length)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } } BoltCursor(long objectId); @Overri...
### Question: BoltCursor implements AutoCloseable { public void delete() { Error.ByValue error = BoltNative.BoltDBCursor_Delete(objectId); error.checkError(); } BoltCursor(long objectId); @Override void close(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[...
### Question: FlowsApi { public Flow create(CreateFlowRequest body) throws ApiException { ApiResponse<Flow> resp = createWithHttpInfo(body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiResp...
### Question: FunctionsApi { public KFFunction create(CreateFunctionRequest body) throws ApiException { ApiResponse<KFFunction> resp = createWithHttpInfo(body); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction creat...
### Question: FunctionsApi { public void delete(String id) throws ApiException { deleteWithHttpInfo(id); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(Creat...
### Question: FunctionsApi { public KFFunction get(String id) throws ApiException { ApiResponse<KFFunction> resp = getWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction create(CreateFunctionRequest b...
### Question: FunctionsApi { public Service getService(String id) throws ApiException { ApiResponse<Service> resp = getServiceWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction create(CreateFunctionR...
### Question: FunctionsApi { public Version getVersion(String id, String versionId) throws ApiException { ApiResponse<Version> resp = getVersionWithHttpInfo(id, versionId); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFu...
### Question: FunctionsApi { public List<Version> getVersions(String id) throws ApiException { ApiResponse<List<Version>> resp = getVersionsWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction create(C...
### Question: FunctionsApi { public List<KFFunction> list() throws ApiException { ApiResponse<List<KFFunction>> resp = listWithHttpInfo(); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction create(CreateFunctionReques...
### Question: FunctionsApi { public ProxyResponse proxy(String id, String body) throws ApiException { ApiResponse<ProxyResponse> resp = proxyWithHttpInfo(id, body); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); KFFunction c...
### Question: FunctionsApi { public Map<String, String> setVersion(String id, String versionId) throws ApiException { ApiResponse<Map<String, String>> resp = setVersionWithHttpInfo(id, versionId); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(Ap...
### Question: FlowsApi { public String delete(String id) throws ApiException { ApiResponse<String> resp = deleteWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiResponse<Flow> ...
### Question: FlowsApi { public Flow deploy(String id) throws ApiException { ApiResponse<Flow> resp = deployWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiResponse<Flow> crea...
### Question: FlowsApi { public Flow get(String id) throws ApiException { ApiResponse<Flow> resp = getWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiResponse<Flow> createWith...
### Question: FlowsApi { public DAGStepRef getModel(String id) throws ApiException { ApiResponse<DAGStepRef> resp = getModelWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiRes...
### Question: FlowsApi { public List<Flow> list() throws ApiException { ApiResponse<List<Flow>> resp = listWithHttpInfo(); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiResponse<Flow> createW...
### Question: FlowsApi { public String saveModel(String id, Object body) throws ApiException { ApiResponse<String> resp = saveModelWithHttpInfo(id, body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest ...
### Question: FlowsApi { public String validate(Object body) throws ApiException { ApiResponse<String> resp = validateWithHttpInfo(body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Flow create(CreateFlowRequest body); ApiRespons...
### Question: ConnectorsApi { public Connector get(String id) throws ApiException { ApiResponse<Connector> resp = getWithHttpInfo(id); return resp.getData(); } ConnectorsApi(); ConnectorsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Connector get(String id); ApiResponse<Co...
### Question: ConnectorsApi { public List<Connector> list() throws ApiException { ApiResponse<List<Connector>> resp = listWithHttpInfo(); return resp.getData(); } ConnectorsApi(); ConnectorsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); Connector get(String id); ApiResponse...
### Question: TableStats { public double estimateScanCost() { return table.numPages() * ioCostPerPage; } TableStats(int tableid, int ioCostPerPage); static TableStats getTableStats(String tablename); static void setTableStats(String tablename, TableStats stats); static void setStatsMap(HashMap<String, TableStats> s); s...
### Question: Join extends Operator { public void rewind() throws DbException, TransactionAbortedException { child1.rewind(); child2.rewind(); joinResults.rewind(); } Join(JoinPredicate p, DbIterator child1, DbIterator child2); @Override String getName(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); St...
### Question: Join extends Operator { public void open() throws DbException, NoSuchElementException, TransactionAbortedException { child1.open(); child2.open(); super.open(); joinResults = blockNestedLoopJoin(); joinResults.open(); } Join(JoinPredicate p, DbIterator child1, DbIterator child2); @Override String getName(...
### Question: TableStats { public int estimateTableCardinality(double selectivityFactor) { return (int) Math.ceil(totalTuples() * selectivityFactor); } TableStats(int tableid, int ioCostPerPage); static TableStats getTableStats(String tablename); static void setTableStats(String tablename, TableStats stats); static voi...
### Question: JoinOptimizer { public double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2) { if (j instanceof LogicalSubplanJoinNode) { return card1 + cost1 + cost2; } else { TupleDesc desc = p.getTupleDesc(j.t1Alias); int blockSize = Join.blockMemory / desc.getSize(); int fullNum...
### Question: JoinOptimizer { public int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats) { if (j instanceof LogicalSubplanJoinNode) { return card1; } else { return estimateTableJoinCardinality(j.p, j.t1Alias, j.t2Alias, j.f1PureName, j.f2Pu...
### Question: Transaction { public void transactionComplete(boolean abort) throws IOException { if (started) { if (abort) { Database.getLogFile().logAbort(tid); } else { Database.getBufferPool().flushPages(tid); Database.getLogFile().logCommit(tid); } try { Database.getBufferPool().transactionComplete(tid, !abort); } c...
### Question: Join extends Operator { public TupleDesc getTupleDesc() { return td; } Join(JoinPredicate p, DbIterator child1, DbIterator child2); @Override String getName(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); voi...
### Question: UserAccount extends BaseAuditableEntity implements SocialUserDetails { public boolean isAuthor(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_AUTHOR){ return true; } } return false; } UserAccount(); UserAccount(String userId, UserRoleType[] roles); String getUserId(); void setUse...
### Question: UserAccount extends BaseAuditableEntity implements SocialUserDetails { public boolean isAdmin(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_ADMIN){ return true; } } return false; } UserAccount(); UserAccount(String userId, UserRoleType[] roles); String getUserId(); void setUserI...
### Question: SingleEntryScope extends AbstractScope implements Scope { public <T> T call(Callable<T> toCall, Object... scopeContents) throws Exception { enter(scopeContents); try { return toCall.call(); } finally { exit(); } } void run(Runnable toRun, Object... scopeContents); T call(Callable<T> toCall, Object... sco...
### Question: ReentrantScope extends AbstractScope { public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } ReentrantScope(); ReentrantScope(Provider<String> injectionInfoProvider); QuietAutoCloseable enter(Object... o); @Override void exit(); boolean inScope(); }### Answer: @Tes...
### Question: ExecutorServiceProvider implements Provider<ExecutorService> { @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result...