target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void successfullyMarkAMessageForResendingInTheFuture() { underTest.resendFailedMessageWithDelay(FAILED_MESSAGE_ID, Duration.ofSeconds(100)); verify(failedMessageService).update(eq(FAILED_MESSAGE_ID), statusUpdateRequest.capture()); assertThat(statusUpdateRequest.getValue(), aStatusUpdateRequest(RESEND) .withUpdatedDateTime(Matchers.equalTo(NOW.plus(100, SECONDS)))); }
@Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); }
ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); } }
ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); } ResendFailedMessageResource(FailedMessageService failedMessageService, Clock clock); }
ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); } ResendFailedMessageResource(FailedMessageService failedMessageService, Clock clock); @Override void resendFailedMessage(FailedMessageId failedMessageId); @Override void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration); }
ResendFailedMessageResource implements ResendFailedMessageClient { @Override public void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration) { failedMessageService.update(failedMessageId, new StatusUpdateRequest(RESEND, Instant.now(clock).plus(duration))); } ResendFailedMessageResource(FailedMessageService failedMessageService, Clock clock); @Override void resendFailedMessage(FailedMessageId failedMessageId); @Override void resendFailedMessageWithDelay(FailedMessageId failedMessageId, Duration duration); }
@Test public void failedMessageWithStatusHistoryEntries() { when(failedMessageDao.getStatusHistory(FAILED_MESSAGE_ID)).thenReturn(Arrays.asList( new StatusHistoryEvent(StatusHistoryEvent.Status.FAILED, NOW), new StatusHistoryEvent(StatusHistoryEvent.Status.SENT, NOW.plusSeconds(1)) )); assertThat(underTest.getStatusHistory(FAILED_MESSAGE_ID), contains( statusHistoryResponse().withStatus(FAILED).withEffectiveDateTime(NOW), statusHistoryResponse().withStatus(SENT).withEffectiveDateTime(NOW.plusSeconds(1)) )); }
@Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
@Test public void responseOnlyContainsASingleEntryWhenFailedAndClassifiedStatusAreConcurrent() { when(failedMessageDao.getStatusHistory(FAILED_MESSAGE_ID)).thenReturn(Arrays.asList( new StatusHistoryEvent(StatusHistoryEvent.Status.FAILED, NOW), new StatusHistoryEvent(StatusHistoryEvent.Status.CLASSIFIED, NOW.plusSeconds(1)) )); assertThat(underTest.getStatusHistory(FAILED_MESSAGE_ID), contains( statusHistoryResponse().withStatus(FAILED).withEffectiveDateTime(NOW.plusSeconds(1)) )); }
@Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
@Test public void singleStatusHistoryEntry() { when(failedMessageDao.getStatusHistory(FAILED_MESSAGE_ID)).thenReturn(Collections.singletonList( new StatusHistoryEvent(StatusHistoryEvent.Status.CLASSIFIED, NOW) )); assertThat(underTest.getStatusHistory(FAILED_MESSAGE_ID), contains( statusHistoryResponse().withStatus(FAILED).withEffectiveDateTime(NOW) )); }
@Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
FailedMessageStatusHistoryResource implements FailedMessageStatusHistoryClient { @Override public List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId) { final List<StatusHistoryResponse> statusHistoryResponses = new ArrayList<>(); final List<StatusHistoryEvent> statusHistory = failedMessageDao.getStatusHistory(failedMessageId); for (int i=0; i<statusHistory.size(); i++) { final FailedMessageStatus failedMessageStatus = toFailedMessageStatus(statusHistory.get(i).getStatus()); if (i+1<statusHistory.size() && failedMessageStatus.equals(toFailedMessageStatus(statusHistory.get(i+1).getStatus()))) { i++; } statusHistoryResponses.add(new StatusHistoryResponse(failedMessageStatus, statusHistory.get(i).getEffectiveDateTime())); } return statusHistoryResponses; } FailedMessageStatusHistoryResource(FailedMessageDao failedMessageDao); @Override List<StatusHistoryResponse> getStatusHistory(FailedMessageId failedMessageId); }
@Test public void createFailedMessage() throws Exception { when(failedMessageFactory.create(request)).thenReturn(failedMessage); underTest.create(request); verify(failedMessageDao).insert(failedMessage); }
public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); }
CreateFailedMessageResource implements CreateFailedMessageClient { public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); } }
CreateFailedMessageResource implements CreateFailedMessageClient { public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); } CreateFailedMessageResource(FailedMessageFactory failedMessageFactory, FailedMessageDao failedMessageDao); }
CreateFailedMessageResource implements CreateFailedMessageClient { public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); } CreateFailedMessageResource(FailedMessageFactory failedMessageFactory, FailedMessageDao failedMessageDao); void create(CreateFailedMessageRequest failedMessageRequest); }
CreateFailedMessageResource implements CreateFailedMessageClient { public void create(CreateFailedMessageRequest failedMessageRequest) { failedMessageDao.insert(failedMessageFactory.create(failedMessageRequest)); } CreateFailedMessageResource(FailedMessageFactory failedMessageFactory, FailedMessageDao failedMessageDao); void create(CreateFailedMessageRequest failedMessageRequest); }
@Test public void createFailedMessageFromRequest() throws Exception { FailedMessage failedMessage = underTest.create(newCreateFailedMessageRequest() .withContent("Hello World") .withBrokerName("broker") .withDestinationName("queue") .withFailedDateTime(NOW) .withFailedMessageId(FAILED_MESSAGE_ID) .withProperties(Collections.singletonMap("foo", "bar")) .withSentDateTime(NOW) .build()); assertThat(failedMessage, aFailedMessage() .withContent(equalTo("Hello World")) .withDestination(DestinationMatcher.aDestination().withBrokerName("broker").withName("queue")) .withFailedAt(equalTo(NOW)) .withFailedMessageId(equalTo(FAILED_MESSAGE_ID)) .withProperties(Matchers.hasEntry("foo", "bar")) .withSentAt(equalTo(NOW)) ); }
public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDestinationName()))) .withFailedDateTime(request.getFailedAt()) .withProperties(request.getProperties()) .withSentDateTime(request.getSentAt()) .withLabels(request.getLabels()) .build(); }
FailedMessageFactory { public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDestinationName()))) .withFailedDateTime(request.getFailedAt()) .withProperties(request.getProperties()) .withSentDateTime(request.getSentAt()) .withLabels(request.getLabels()) .build(); } }
FailedMessageFactory { public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDestinationName()))) .withFailedDateTime(request.getFailedAt()) .withProperties(request.getProperties()) .withSentDateTime(request.getSentAt()) .withLabels(request.getLabels()) .build(); } }
FailedMessageFactory { public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDestinationName()))) .withFailedDateTime(request.getFailedAt()) .withProperties(request.getProperties()) .withSentDateTime(request.getSentAt()) .withLabels(request.getLabels()) .build(); } FailedMessage create(CreateFailedMessageRequest request); }
FailedMessageFactory { public FailedMessage create(CreateFailedMessageRequest request) { return FailedMessageBuilder.newFailedMessage() .withFailedMessageId(request.getFailedMessageId()) .withContent(request.getContent()) .withDestination(new Destination(request.getBrokerName(), ofNullable(request.getDestinationName()))) .withFailedDateTime(request.getFailedAt()) .withProperties(request.getProperties()) .withSentDateTime(request.getSentAt()) .withLabels(request.getLabels()) .build(); } FailedMessage create(CreateFailedMessageRequest request); }
@Test public void findMessageById() { when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.of(failedMessage)); when(failedMessage.getStatus()).thenReturn(FAILED); when(failedMessageResponseFactory.create(failedMessage)).thenReturn(failedMessageResponse); assertThat(underTest.getFailedMessage(FAILED_MESSAGE_ID), is(failedMessageResponse)); }
@Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
@Test public void findMessageByIdThrowsNotFoundExceptionWhenMessageDoesNotExist() { expectedException.expect(NotFoundException.class); expectedException.expectMessage("Failed Message: " + FAILED_MESSAGE_ID + " not found"); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.empty()); underTest.getFailedMessage(FAILED_MESSAGE_ID); verifyZeroInteractions(failedMessageResponseFactory); }
@Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
@Test public void findMessageByIdThrowsNotFoundExceptionWhenMessageIsDeleted() { expectedException.expect(NotFoundException.class); expectedException.expectMessage("Failed Message: " + FAILED_MESSAGE_ID + " not found"); when(failedMessageDao.findById(FAILED_MESSAGE_ID)).thenReturn(Optional.of(failedMessage)); when(failedMessage.getStatus()).thenReturn(DELETED); underTest.getFailedMessage(FAILED_MESSAGE_ID); verifyZeroInteractions(failedMessageResponseFactory); }
@Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId) { return failedMessageDao.findById(failedMessageId) .filter(failedMessage -> !DELETED.equals(failedMessage.getStatus())) .map(failedMessageResponseFactory::create) .orElseThrow(() -> new NotFoundException(format("Failed Message: %s not found", failedMessageId))); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
@Test public void removeRecordsQueryCreatedSuccessfully() { assertThat(underTest.create(), allOf( hasField(STATUS_HISTORY + ".0." + STATUS, equalTo(StatusHistoryEvent.Status.DELETED.name())), hasField(STATUS_HISTORY + ".0." + EFFECTIVE_DATE_TIME, hasField(QueryOperators.LT, notNullValue(Instant.class))) )); }
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))); }
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))); } }
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))); } }
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(); }
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(); }
@Test public void validSearch() { FailedMessage failedMessage = mock(FailedMessage.class); SearchFailedMessageResponse searchFailedMessageResponse = mock(SearchFailedMessageResponse.class); SearchFailedMessageRequest searchFailedMessageRequest = mock(SearchFailedMessageRequest.class); when(searchFailedMessageRequest.getBroker()).thenReturn(Optional.of("broker")); when(failedMessageSearchService.search(searchFailedMessageRequest)).thenReturn(singletonList(failedMessage)); when(searchFailedMessageResponseAdapter.toResponse(failedMessage)).thenReturn(searchFailedMessageResponse); final Collection<SearchFailedMessageResponse> results = underTest.search(searchFailedMessageRequest); assertThat(results, contains(searchFailedMessageResponse)); verify(failedMessageSearchService).search(Mockito.refEq(searchFailedMessageRequest)); }
@Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toList()); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toList()); } }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toList()); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toList()); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
FailedMessageSearchResource implements SearchFailedMessageClient { @Override public Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request) { return failedMessageSearchService.search(request) .stream() .map(searchFailedMessageResponseAdapter::toResponse) .collect(Collectors.toList()); } FailedMessageSearchResource(FailedMessageDao failedMessageDao, FailedMessageResponseFactory failedMessageResponseFactory, FailedMessageSearchService failedMessageSearchService, SearchFailedMessageResponseAdapter searchFailedMessageResponseAdapter); @Override FailedMessageResponse getFailedMessage(FailedMessageId failedMessageId); @Override Collection<SearchFailedMessageResponse> search(SearchFailedMessageRequest request); }
@Test public void resourceDelegatesToTheFailedMessageService() { underTest.update(FAILED_MESSAGE_ID, FailedMessageUpdateRequest.aNewFailedMessageUpdateRequest().withUpdateRequest(updateRequest).build()); verify(failedMessageService).update(FAILED_MESSAGE_ID, Collections.singletonList(updateRequest)); }
@Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); }
UpdateFailedMessageResource implements UpdateFailedMessageClient { @Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); } }
UpdateFailedMessageResource implements UpdateFailedMessageClient { @Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); } UpdateFailedMessageResource(FailedMessageService failedMessageService); }
UpdateFailedMessageResource implements UpdateFailedMessageClient { @Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); } UpdateFailedMessageResource(FailedMessageService failedMessageService); @Override void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest); }
UpdateFailedMessageResource implements UpdateFailedMessageClient { @Override public void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest) { failedMessageService.update(failedMessageId, failedMessageUpdateRequest.getUpdateRequests()); } UpdateFailedMessageResource(FailedMessageService failedMessageService); @Override void update(FailedMessageId failedMessageId, FailedMessageUpdateRequest failedMessageUpdateRequest); }
@Test public void extractTextFromMessage() throws Exception { TextMessage textMessage = mock(TextMessage.class); when(textMessage.getText()).thenReturn("Text"); assertThat(underTest.extractText(textMessage), is("Text")); }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } String extractText(Message message); }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } String extractText(Message message); }
@Test public void throwsExceptionIfNotTextMessage() throws Exception { expectedException.expect(RuntimeException.class); expectedException.expectMessage(allOf(startsWith("Expected TextMessage received:"), containsString("javax.jms.BytesMessage"))); underTest.extractText(mock(BytesMessage.class)); }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } String extractText(Message message); }
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", textMessage.toString()); LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } } else { String errorMsg = String.format("Expected TextMessage received: %s", message.getClass().getName()); LOGGER.error(errorMsg); throw new RuntimeException(errorMsg); } } String extractText(Message message); }
@Test public void processingContinuesObjectPropertyCannotBeWritten() throws JMSException { when(failedMessage.getContent()).thenReturn("content"); when(failedMessage.getProperties()).thenReturn(ImmutableMap.of("foo", "bar", "ham", "eggs")); when(failedMessage.getFailedMessageId()).thenReturn(FAILED_MESSAGE_ID); doThrow(new JMSException("Arrrghhhhh")).when(textMessage).setObjectProperty("foo", "bar"); underTest.transform(textMessage, failedMessage); verify(textMessage).setText("content"); verify(textMessage).setObjectProperty("foo", "bar"); verify(textMessage).setObjectProperty("ham", "eggs"); verify(textMessage).setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, FAILED_MESSAGE_ID.toString()); }
@Override public void transform(TextMessage textMessage, FailedMessage data) throws JMSException { textMessage.setText(data.getContent()); Map<String, Object> properties = data.getProperties(); properties.keySet().forEach(key -> { try { textMessage.setObjectProperty(key, properties.get(key)); } catch (JMSException ignore) { LOGGER.warn("Could not add property: '{}' when sending FailedMessage: {}", key, data.getFailedMessageId()); } }); textMessage.setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, data.getFailedMessageId().toString()); }
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().forEach(key -> { try { textMessage.setObjectProperty(key, properties.get(key)); } catch (JMSException ignore) { LOGGER.warn("Could not add property: '{}' when sending FailedMessage: {}", key, data.getFailedMessageId()); } }); textMessage.setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, data.getFailedMessageId().toString()); } }
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().forEach(key -> { try { textMessage.setObjectProperty(key, properties.get(key)); } catch (JMSException ignore) { LOGGER.warn("Could not add property: '{}' when sending FailedMessage: {}", key, data.getFailedMessageId()); } }); textMessage.setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, data.getFailedMessageId().toString()); } }
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().forEach(key -> { try { textMessage.setObjectProperty(key, properties.get(key)); } catch (JMSException ignore) { LOGGER.warn("Could not add property: '{}' when sending FailedMessage: {}", key, data.getFailedMessageId()); } }); textMessage.setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, data.getFailedMessageId().toString()); } @Override void transform(TextMessage textMessage, FailedMessage data); }
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().forEach(key -> { try { textMessage.setObjectProperty(key, properties.get(key)); } catch (JMSException ignore) { LOGGER.warn("Could not add property: '{}' when sending FailedMessage: {}", key, data.getFailedMessageId()); } }); textMessage.setStringProperty(FailedMessageId.FAILED_MESSAGE_ID, data.getFailedMessageId().toString()); } @Override void transform(TextMessage textMessage, FailedMessage data); }
@Test public void processMessageSuccessfully() throws Exception { when(failedMessageFactory.createFailedMessage(message)).thenReturn(failedMessage); underTest.onMessage(message); verify(failedMessageProcessor).process(failedMessage); }
@Override public void onMessage(Message message) { try { LOGGER.debug("Received message: {} with CorrelationId: {}", message.getJMSMessageID(), message.getJMSCorrelationID()); failedMessageProcessor.process(failedMessageFactory.createFailedMessage(message)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); @Override void onMessage(Message message); }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); @Override void onMessage(Message message); }
@Test public void exceptionIsThrownRetrievingTheJMSMessageId() throws JMSException { when(message.getJMSMessageID()).thenThrow(JMSException.class); underTest.onMessage(message); verifyZeroInteractions(failedMessageProcessor); }
@Override public void onMessage(Message message) { try { LOGGER.debug("Received message: {} with CorrelationId: {}", message.getJMSMessageID(), message.getJMSCorrelationID()); failedMessageProcessor.process(failedMessageFactory.createFailedMessage(message)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); @Override void onMessage(Message message); }
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)); } catch (JMSException e) { LOGGER.error("Could not read jmsMessageId or correlationId", e); } } FailedMessageListener(FailedMessageFactory failedMessageFactory, FailedMessageProcessor failedMessageProcessor); @Override void onMessage(Message message); }
@Test public void exceptionIsThrownIfMessageIsNull() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Message cannot be null"); underTest.extractProperties(null); }
@Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
@Test public void messageWithNoProperties() throws JMSException { when(message.getPropertyNames()).thenReturn(emptyEnumeration()); Map<String, Object> properties = underTest.extractProperties(message); assertThat(properties, equalTo(emptyMap())); }
@Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
@Test public void messageWithProperties() throws Exception { Enumeration<String> messageProperties = messageProperties(Pair.of("foo", "bar"), Pair.of("one", 1)); when(message.getPropertyNames()).thenReturn(messageProperties); Map<String, Object> actual = underTest.extractProperties(message); assertThat(actual, hasEntry("foo", "bar")); assertThat(actual, hasEntry("one", 1)); }
@Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
JmsMessagePropertyExtractor implements MessagePropertyExtractor { @Override public Map<String, Object> extractProperties(Message message) { if (message == null) { throw new IllegalArgumentException("Message cannot be null"); } Map<String, Object> properties = new HashMap<>(); try { for (Enumeration propertyNames = message.getPropertyNames(); propertyNames.hasMoreElements(); ) { extractPropertyFromMessage((String) propertyNames.nextElement(), message, properties); } } catch (JMSException e) { LOGGER.error("Could not read propertyNames from message '%s'", message, e); } return properties; } @Override Map<String, Object> extractProperties(Message message); }
@Test public void createId() { assertThat(underTest.createId(FAILED_MESSAGE_ID), equalTo(new Document("_id", FAILED_MESSAGE_ID_AS_STRING))); }
@Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); }
FailedMessageConverter implements DocumentWithIdConverter<FailedMessage, FailedMessageId> { @Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); } }
FailedMessageConverter implements DocumentWithIdConverter<FailedMessage, FailedMessageId> { @Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); } FailedMessageConverter(DocumentConverter<Destination> destinationDocumentConverter, DocumentConverter<StatusHistoryEvent> statusHistoryEventDocumentConverter, ObjectConverter<Map<String, Object>, String> propertiesMongoMapper); }
FailedMessageConverter implements DocumentWithIdConverter<FailedMessage, FailedMessageId> { @Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); } FailedMessageConverter(DocumentConverter<Destination> destinationDocumentConverter, DocumentConverter<StatusHistoryEvent> statusHistoryEventDocumentConverter, ObjectConverter<Map<String, Object>, String> propertiesMongoMapper); @Override FailedMessage convertToObject(Document document); StatusHistoryEvent getStatusHistoryEvent(Document document); FailedMessageId getFailedMessageId(Document document); Destination getDestination(Document document); String getContent(Document document); Instant getFailedDateTime(Document document); Instant getSentDateTime(Document document); @Override Document convertFromObject(FailedMessage item); Document convertForUpdate(FailedMessage item); @Override Document createId(FailedMessageId failedMessageId); }
FailedMessageConverter implements DocumentWithIdConverter<FailedMessage, FailedMessageId> { @Override public Document createId(FailedMessageId failedMessageId) { return new Document("_id", failedMessageId.getId().toString()); } FailedMessageConverter(DocumentConverter<Destination> destinationDocumentConverter, DocumentConverter<StatusHistoryEvent> statusHistoryEventDocumentConverter, ObjectConverter<Map<String, Object>, String> propertiesMongoMapper); @Override FailedMessage convertToObject(Document document); StatusHistoryEvent getStatusHistoryEvent(Document document); FailedMessageId getFailedMessageId(Document document); Destination getDestination(Document document); String getContent(Document document); Instant getFailedDateTime(Document document); Instant getSentDateTime(Document document); @Override Document convertFromObject(FailedMessage item); Document convertForUpdate(FailedMessage item); @Override Document createId(FailedMessageId failedMessageId); static final String DESTINATION; static final String SENT_DATE_TIME; static final String FAILED_DATE_TIME; static final String CONTENT; static final String PROPERTIES; static final String STATUS_HISTORY; static final String LABELS; static final String JMS_MESSAGE_ID; }
@Test public void size() { CircularBuffer<Integer> queue = new CircularBuffer<>(2); assertEquals(0, queue.size()); queue.enqueue(0); queue.enqueue(1); assertEquals(2, queue.size()); queue.enqueue(3); assertEquals(2, queue.size()); }
public int size() { return currentSize; }
CircularBuffer { public int size() { return currentSize; } }
CircularBuffer { public int size() { return currentSize; } CircularBuffer(int size); }
CircularBuffer { public int size() { return currentSize; } CircularBuffer(int size); void enqueue(T item); int size(); @SuppressWarnings("unchecked") T getItem(int index); }
CircularBuffer { public int size() { return currentSize; } CircularBuffer(int size); void enqueue(T item); int size(); @SuppressWarnings("unchecked") T getItem(int index); }
@Test public void getItem() { CircularBuffer<Integer> queue = new CircularBuffer<>(3); queue.enqueue(0); assertEquals((Integer) 0, queue.getItem(0)); queue.enqueue(1); assertEquals((Integer) 1, queue.getItem(0)); assertEquals((Integer) 0, queue.getItem(1)); queue.enqueue(2); assertEquals((Integer) 2, queue.getItem(0)); assertEquals((Integer) 1, queue.getItem(1)); assertEquals((Integer) 0, queue.getItem(2)); queue.enqueue(3); assertEquals((Integer) 3, queue.getItem(0)); assertEquals((Integer) 2, queue.getItem(1)); assertEquals((Integer) 1, queue.getItem(2)); }
@SuppressWarnings("unchecked") public T getItem(int index) { int target = head - index; if (target < 0) target = queue.length + target; return (T) queue[target]; }
CircularBuffer { @SuppressWarnings("unchecked") public T getItem(int index) { int target = head - index; if (target < 0) target = queue.length + target; return (T) queue[target]; } }
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); }
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); }
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); }
@Test public void testGetStartedTime() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); ObjectMeta metadata = new ObjectMeta(); metadata.setName("foo"); Pod pod = new Pod("1.0", "kind", metadata, new PodSpec(), new PodStatusBuilder().withStartTime("2017-06-12T22:59Z").build()); m.checking(new Expectations(){{ allowing(myApi).getPodStatus(with("foo")); will(returnValue(pod.getStatus())); }}); KubeCloudInstanceImpl instance = new KubeCloudInstanceImpl(image, pod); Date startedTime = instance.getStartedTime(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); assertEquals("2017-06-12T22:59Z", dateFormat.format(startedTime)); }
@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 && !podConditions.isEmpty()) { for (PodCondition podCondition : podConditions) { if (PodConditionType.valueOf(podCondition.getType()) == PodConditionType.Ready) return myPodTransitionTimeFormat.parse(podCondition.getLastTransitionTime()); } } String startTime = podStatus.getStartTime(); return !StringUtil.isEmpty(startTime) ? myPodStartTimeFormat.parse(startTime) : myCreationTime; } catch (ParseException e) { throw new KubeCloudException("Failed to get instance start date", e); } }
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 && !podConditions.isEmpty()) { for (PodCondition podCondition : podConditions) { if (PodConditionType.valueOf(podCondition.getType()) == PodConditionType.Ready) return myPodTransitionTimeFormat.parse(podCondition.getLastTransitionTime()); } } String startTime = podStatus.getStartTime(); return !StringUtil.isEmpty(startTime) ? myPodStartTimeFormat.parse(startTime) : myCreationTime; } catch (ParseException e) { throw new KubeCloudException("Failed to get instance start date", e); } } }
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 && !podConditions.isEmpty()) { for (PodCondition podCondition : podConditions) { if (PodConditionType.valueOf(podCondition.getType()) == PodConditionType.Ready) return myPodTransitionTimeFormat.parse(podCondition.getLastTransitionTime()); } } String startTime = podStatus.getStartTime(); return !StringUtil.isEmpty(startTime) ? myPodStartTimeFormat.parse(startTime) : myCreationTime; } catch (ParseException e) { throw new KubeCloudException("Failed to get instance start date", e); } } KubeCloudInstanceImpl(@NotNull KubeCloudImage kubeCloudImage, @NotNull Pod pod); }
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 && !podConditions.isEmpty()) { for (PodCondition podCondition : podConditions) { if (PodConditionType.valueOf(podCondition.getType()) == PodConditionType.Ready) return myPodTransitionTimeFormat.parse(podCondition.getLastTransitionTime()); } } String startTime = podStatus.getStartTime(); return !StringUtil.isEmpty(startTime) ? myPodStartTimeFormat.parse(startTime) : myCreationTime; } catch (ParseException e) { throw new KubeCloudException("Failed to get instance start date", e); } } KubeCloudInstanceImpl(@NotNull KubeCloudImage kubeCloudImage, @NotNull Pod pod); @NotNull @Override String getInstanceId(); @NotNull @Override String getName(); @NotNull @Override String getImageId(); @NotNull @Override KubeCloudImage getImage(); @Override void setStatus(final InstanceStatus status); @NotNull @Override Date getStartedTime(); @Nullable @Override String getNetworkIdentity(); @NotNull @Override InstanceStatus getStatus(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean containsAgent(@NotNull AgentDescription agentDescription); void updateState(@NotNull Pod actualPod); @Override void setError(@Nullable final CloudErrorInfo errorInfo); @Override @Nullable String getPVCName(); }
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 && !podConditions.isEmpty()) { for (PodCondition podCondition : podConditions) { if (PodConditionType.valueOf(podCondition.getType()) == PodConditionType.Ready) return myPodTransitionTimeFormat.parse(podCondition.getLastTransitionTime()); } } String startTime = podStatus.getStartTime(); return !StringUtil.isEmpty(startTime) ? myPodStartTimeFormat.parse(startTime) : myCreationTime; } catch (ParseException e) { throw new KubeCloudException("Failed to get instance start date", e); } } KubeCloudInstanceImpl(@NotNull KubeCloudImage kubeCloudImage, @NotNull Pod pod); @NotNull @Override String getInstanceId(); @NotNull @Override String getName(); @NotNull @Override String getImageId(); @NotNull @Override KubeCloudImage getImage(); @Override void setStatus(final InstanceStatus status); @NotNull @Override Date getStartedTime(); @Nullable @Override String getNetworkIdentity(); @NotNull @Override InstanceStatus getStatus(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean containsAgent(@NotNull AgentDescription agentDescription); void updateState(@NotNull Pod actualPod); @Override void setError(@Nullable final CloudErrorInfo errorInfo); @Override @Nullable String getPVCName(); }
@Test public void testIsInitialized() throws Exception { assertTrue(createClient(Collections.emptyList()).isInitialized()); }
@Override public boolean isInitialized() { return true; }
KubeCloudClient implements CloudClientEx { @Override public boolean isInitialized() { return true; } }
KubeCloudClient implements CloudClientEx { @Override public boolean isInitialized() { return true; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean isInitialized() { return true; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean isInitialized() { return true; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance_UnknownImage() throws Exception { KubeCloudClient cloudClient = createClient(Collections.emptyList()); CloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getId(); will(returnValue("image-1-id")); }}); assertFalse(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getName(); will(returnValue("image-1-name")); allowing(image).getId(); will(returnValue("image-1-id")); allowing(image).getRunningInstanceCount(); will(returnValue(0)); allowing(image).getInstanceLimit(); will(returnValue(0)); }}); List<KubeCloudImage> images = Collections.singletonList(image); KubeCloudClient cloudClient = createClient(images); assertFalse(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance2() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getName(); will(returnValue("image-1-name")); allowing(image).getId(); will(returnValue("image-1-id")); allowing(image).getRunningInstanceCount(); will(returnValue(1)); allowing(image).getInstanceLimit(); will(returnValue(5)); }}); List<KubeCloudImage> images = Collections.singletonList(image); KubeCloudClient cloudClient = createClient(images); assertTrue(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance_ProfileLimit() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getId(); will(returnValue("image-1-id")); allowing(image).getRunningInstanceCount(); will(returnValue(1)); allowing(image).getInstanceLimit(); will(returnValue(2)); }}); List<KubeCloudImage> images = Collections.singletonList(image); CloudClientParameters cloudClientParameters = new MockCloudClientParameters(Collections.singletonMap(PROFILE_INSTANCE_LIMIT, "1")); KubeCloudClient cloudClient = createClient(images, cloudClientParameters); assertFalse(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance_ProfileLimit2() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getId(); will(returnValue("image-1-id")); allowing(image).getRunningInstanceCount(); will(returnValue(3)); allowing(image).getInstanceLimit(); will(returnValue(5)); }}); List<KubeCloudImage> images = Collections.singletonList(image); CloudClientParameters cloudClientParameters = new MockCloudClientParameters(Collections.singletonMap(PROFILE_INSTANCE_LIMIT, "5")); KubeCloudClient cloudClient = createClient(images, cloudClientParameters); assertTrue(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void testCanStartNewInstance_ImageLimit() throws Exception { KubeCloudImage image = m.mock(KubeCloudImage.class); m.checking(new Expectations(){{ allowing(image).getName(); will(returnValue("image-1-name")); allowing(image).getId(); will(returnValue("image-1-id")); allowing(image).getRunningInstanceCount(); will(returnValue(1)); allowing(image).getInstanceLimit(); will(returnValue(1)); }}); List<KubeCloudImage> images = Collections.singletonList(image); KubeCloudClient cloudClient = createClient(images); assertFalse(cloudClient.canStartNewInstance(image)); }
@Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
KubeCloudClient implements CloudClientEx { @Override public boolean canStartNewInstance(@NotNull CloudImage cloudImage) { KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage; String kubeCloudImageId = kubeCloudImage.getId(); if(!myImageIdToImageMap.containsKey(kubeCloudImageId)){ LOG.debug("Can't start instance of unknown cloud image with id " + kubeCloudImageId); return false; } int profileInstanceLimit = myKubeClientParams.getInstanceLimit(); if(profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount).sum() >= profileInstanceLimit) return false; int imageLimit = kubeCloudImage.getInstanceLimit(); return imageLimit < 0 || kubeCloudImage.getRunningInstanceCount() < imageLimit; } KubeCloudClient(@NotNull KubeApiConnector apiConnector, @Nullable String serverUuid, @NotNull String cloudProfileId, @NotNull List<KubeCloudImage> images, @NotNull KubeCloudClientParametersImpl kubeClientParams, @NotNull KubeBackgroundUpdater updater, @NotNull BuildAgentPodTemplateProviders podTemplateProviders, @Nullable ExecutorService executorService, @NotNull KubePodNameGenerator nameGenerator); @Override boolean isInitialized(); @Override void dispose(); @NotNull @Override CloudInstance startNewInstance(@NotNull CloudImage cloudImage, @NotNull CloudInstanceUserData cloudInstanceUserData); @Override void restartInstance(@NotNull CloudInstance cloudInstance); @Override void terminateInstance(@NotNull CloudInstance cloudInstance); @Nullable @Override CloudImage findImageById(@NotNull String imageId); @Nullable @Override CloudInstance findInstanceByAgent(@NotNull AgentDescription agentDescription); @NotNull @Override Collection<? extends CloudImage> getImages(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Override boolean canStartNewInstance(@NotNull CloudImage cloudImage); @Nullable @Override String generateAgentName(@NotNull AgentDescription agentDescription); String getProfileId(); }
@Test public void create_and_free() { BoltOptions boltOptions = new BoltOptions(); boltOptions.close(); }
@Override public void close() { BoltNative.BoltDBOptions_Free(objectId); }
BoltOptions implements AutoCloseable { @Override public void close() { BoltNative.BoltDBOptions_Free(objectId); } }
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); }
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(); }
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(); }
@Test public void delete() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try(BoltBucket bucket = boltTransaction.createBucket("test".getBytes())) { byte[] key = "foo".getBytes(); byte[] value = "bar".getBytes(); bucket.put(key, value); bucket.delete(key); byte[] getValue = bucket.get(key); Assert.assertNull(getValue); } }); } }
public void delete(byte[] key) { Error.ByValue error = BoltNative.BoltDBBucket_Delete(objectId, key, key.length); error.checkError(); }
BoltBucket implements AutoCloseable { public void delete(byte[] key) { Error.ByValue error = BoltNative.BoltDBBucket_Delete(objectId, key, key.length); error.checkError(); } }
BoltBucket implements AutoCloseable { public void delete(byte[] key) { Error.ByValue error = BoltNative.BoltDBBucket_Delete(objectId, key, key.length); error.checkError(); } BoltBucket(long objectId); }
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[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
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[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
@Test @SuppressWarnings("EmptyTryBlock") public void create_bucket() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try(BoltBucket parentBucket = boltTransaction.createBucket("parent".getBytes())) { try(BoltBucket ignored = parentBucket.createBucket("test".getBytes())) {} } }); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBBucket_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
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 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); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
@Test(expected = BoltException.class) public void create_bucket_with_empty_name() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket parentBucket = boltTransaction.createBucket("parent".getBytes())) { parentBucket.createBucket("".getBytes()); } }); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBBucket_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
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 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); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
@Test(expected = BoltException.class) @SuppressWarnings("EmptyTryBlock") public void create_bucket_twice() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket parentBucket = boltTransaction.createBucket("parent".getBytes())) { try (BoltBucket ignored = parentBucket.createBucket(bucketName)) {} parentBucket.createBucket(bucketName); } }); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBBucket_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
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 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); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
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[] key); void put(byte[] key, byte[] value); void delete(byte[] key); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); long nextSequenceId(); BoltBucketStats getStats(); }
@Test public void commit_transaction() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { BoltTransaction boltTransaction = bolt.begin(true); boltTransaction.commit(); } }
public void commit() { Error.ByValue error = BoltNative.BoltDBTransaction_Commit(objectId); error.checkError(); }
BoltTransaction { public void commit() { Error.ByValue error = BoltNative.BoltDBTransaction_Commit(objectId); error.checkError(); } }
BoltTransaction { public void commit() { Error.ByValue error = BoltNative.BoltDBTransaction_Commit(objectId); error.checkError(); } BoltTransaction(long objectId); }
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(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test public void rollback_transaction() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { BoltTransaction boltTransaction = bolt.begin(true); boltTransaction.rollback(); } }
public void rollback() { Error.ByValue error = BoltNative.BoltDBTransaction_Rollback(objectId); error.checkError(); }
BoltTransaction { public void rollback() { Error.ByValue error = BoltNative.BoltDBTransaction_Rollback(objectId); error.checkError(); } }
BoltTransaction { public void rollback() { Error.ByValue error = BoltNative.BoltDBTransaction_Rollback(objectId); error.checkError(); } BoltTransaction(long objectId); }
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 createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test public void get_transaction_id() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> Assert.assertTrue(boltTransaction.getId() > 0)); } }
public int getId() { return BoltNative.BoltDBTransaction_GetId(objectId); }
BoltTransaction { public int getId() { return BoltNative.BoltDBTransaction_GetId(objectId); } }
BoltTransaction { public int getId() { return BoltNative.BoltDBTransaction_GetId(objectId); } BoltTransaction(long objectId); }
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[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test public void get_database_size() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> Assert.assertTrue(boltTransaction.getDatabaseSize() > 0)); } }
public long getDatabaseSize() { return BoltNative.BoltDBTransaction_Size(objectId); }
BoltTransaction { public long getDatabaseSize() { return BoltNative.BoltDBTransaction_Size(objectId); } }
BoltTransaction { public long getDatabaseSize() { return BoltNative.BoltDBTransaction_Size(objectId); } BoltTransaction(long objectId); }
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 deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test @SuppressWarnings("EmptyTryBlock") public void create_bucket() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucket("test".getBytes())) {} }); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test(expected = BoltException.class) public void create_bucket_with_empty_name() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> boltTransaction.createBucket("".getBytes())); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test public void move_first() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucket(bucketName)) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue first = cursor.first(); Assert.assertNotNull(first); Assert.assertArrayEquals(bucketName, first.getKey()); Assert.assertNull(first.getValue()); } } }); } }
public BoltKeyValue first() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_First(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test(expected = BoltException.class) @SuppressWarnings("EmptyTryBlock") public void create_bucket_twice() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucket(bucketName)) {} boltTransaction.createBucket(bucketName); }); } }
public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test @SuppressWarnings("EmptyTryBlock") public void create_bucket_if_not_exists() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucketIfNotExists(bucketName)) {} }); } }
public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test(expected = BoltException.class) public void create_bucket_if_not_exists_with_empty_name() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> boltTransaction.createBucketIfNotExists("".getBytes())); } }
public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test @SuppressWarnings("EmptyTryBlock") public void create_bucket_if_not_exists_twice() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucketIfNotExists(bucketName)) {} try (BoltBucket ignored = boltTransaction.createBucketIfNotExists(bucketName)) {} }); } }
public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket createBucketIfNotExists(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_CreateBucketIfNotExists(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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(); int getId(); long getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test(expected = BoltException.class) public void delete_bucket_with_empty_name() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> boltTransaction.deleteBucket("".getBytes())); } }
public void deleteBucket(byte[] name) { Error.ByValue error = BoltNative.BoltDBTransaction_DeleteBucket(objectId, name, name.length); error.checkError(); }
BoltTransaction { public void deleteBucket(byte[] name) { Error.ByValue error = BoltNative.BoltDBTransaction_DeleteBucket(objectId, name, name.length); error.checkError(); } }
BoltTransaction { public void deleteBucket(byte[] name) { Error.ByValue error = BoltNative.BoltDBTransaction_DeleteBucket(objectId, name, name.length); error.checkError(); } BoltTransaction(long objectId); }
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[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test(expected = BoltException.class) public void get_bucket_with_empty_name() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> boltTransaction.getBucket("".getBytes())); } }
public BoltBucket getBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_Bucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); }
BoltTransaction { public BoltBucket getBucket(byte[] name) { Result.ByValue result = BoltNative.BoltDBTransaction_Bucket(objectId, name, name.length); result.checkError(); return new BoltBucket(result.objectId); } }
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); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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 getDatabaseSize(); BoltBucket createBucket(byte[] name); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test @SuppressWarnings("EmptyTryBlock") public void create_cursor() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltCursor ignored = boltTransaction.createCursor()) {} }); } }
public BoltCursor createCursor() { long cursorObjectId = BoltNative.BoltDBTransaction_Cursor(objectId); return new BoltCursor(cursorObjectId); }
BoltTransaction { public BoltCursor createCursor() { long cursorObjectId = BoltNative.BoltDBTransaction_Cursor(objectId); return new BoltCursor(cursorObjectId); } }
BoltTransaction { public BoltCursor createCursor() { long cursorObjectId = BoltNative.BoltDBTransaction_Cursor(objectId); return new BoltCursor(cursorObjectId); } BoltTransaction(long objectId); }
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); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
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); BoltBucket createBucketIfNotExists(byte[] name); void deleteBucket(byte[] name); BoltBucket getBucket(byte[] name); BoltCursor createCursor(); BoltTransactionStats getStats(); }
@Test public void open_and_close() throws IOException { Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath()); bolt.close(); }
public void close() { BoltNative.BoltDB_Close(objectId); }
Bolt implements AutoCloseable { public void close() { BoltNative.BoltDB_Close(objectId); } }
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); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test public void open_from_other_thread() { Thread thread = new Thread(() -> { try { Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath()); bolt.close(); } catch (Throwable e) { Assert.fail("Bolt adapter can't be created in other thread."); } }); thread.run(); }
public void close() { BoltNative.BoltDB_Close(objectId); }
Bolt implements AutoCloseable { public void close() { BoltNative.BoltDB_Close(objectId); } }
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); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test @Ignore public void open_and_close_with_file_mode() throws IOException { Path databaseFileName = Paths.get(testFolder.getRoot().getAbsolutePath(), "bd.bolt"); EnumSet<BoltFileMode> fileMode = EnumSet.of(BoltFileMode.USER_READ, BoltFileMode.USER_WRITE, BoltFileMode.GROUP_READ, BoltFileMode.GROUP_WRITE); Bolt bolt = new Bolt(databaseFileName.toString(), fileMode); bolt.close(); Set<PosixFilePermission> permissions = Files.getPosixFilePermissions(databaseFileName); Assert.assertEquals(4, permissions.size()); Assert.assertTrue(permissions.containsAll(Arrays.asList(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE, PosixFilePermission.GROUP_READ, PosixFilePermission.GROUP_WRITE))); }
public void close() { BoltNative.BoltDB_Close(objectId); }
Bolt implements AutoCloseable { public void close() { BoltNative.BoltDB_Close(objectId); } }
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); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test public void move_first_when_not_exists() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue first = cursor.first(); Assert.assertNull(first); } }); } }
public BoltKeyValue first() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_First(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void open_and_close_with_options() throws IOException { try(BoltOptions boltOptions = new BoltOptions()) { Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath(), BoltFileMode.DEFAULT, boltOptions); bolt.close(); } }
public void close() { BoltNative.BoltDB_Close(objectId); }
Bolt implements AutoCloseable { public void close() { BoltNative.BoltDB_Close(objectId); } }
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); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test public void open_update_transaction() throws IOException { String databaseFileName = testFolder.newFile().getAbsolutePath(); try(Bolt bolt = new Bolt(databaseFileName)) { final boolean[] wasInTransaction = {false}; bolt.update(boltTransaction -> { Assert.assertNotNull(boltTransaction); wasInTransaction[0] = true; }); Assert.assertTrue(wasInTransaction[0]); } }
public void update(Consumer<BoltTransaction> callback) { BoltTransaction transaction = begin(true); try { callback.accept(transaction); transaction.commit(); } catch (Throwable ex) { transaction.rollback(); throw ex; } }
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 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 databaseFileName, EnumSet<BoltFileMode> fileMode); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); }
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 databaseFileName, EnumSet<BoltFileMode> fileMode); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); void close(); BoltTransaction begin(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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 databaseFileName, EnumSet<BoltFileMode> fileMode); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); void close(); BoltTransaction begin(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test public void open_view_transaction() throws IOException { String databaseFileName = testFolder.newFile().getAbsolutePath(); try(Bolt bolt = new Bolt(databaseFileName)) { final boolean[] wasInTransaction = {false}; bolt.view(boltTransaction -> { Assert.assertNotNull(boltTransaction); wasInTransaction[0] = true; }); Assert.assertTrue(wasInTransaction[0]); } }
public void view(Consumer<BoltTransaction> callback) { BoltTransaction transaction = begin(false); try { callback.accept(transaction); } finally { transaction.rollback(); } }
Bolt implements AutoCloseable { public void view(Consumer<BoltTransaction> callback) { BoltTransaction transaction = begin(false); try { callback.accept(transaction); } finally { transaction.rollback(); } } }
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); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); }
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); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); void close(); BoltTransaction begin(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
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); Bolt(String databaseFileName, EnumSet<BoltFileMode> fileMode, BoltOptions options); void close(); BoltTransaction begin(boolean writeable); void update(Consumer<BoltTransaction> callback); void view(Consumer<BoltTransaction> callback); BoltStats getStats(); static void init(); }
@Test public void move_last() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored = boltTransaction.createBucket(bucketName)) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue last = cursor.last(); Assert.assertNotNull(last); Assert.assertArrayEquals(bucketName, last.getKey()); Assert.assertNull(last.getValue()); } } }); } }
public BoltKeyValue last() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Last(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void move_last_when_not_exists() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue last = cursor.last(); Assert.assertNull(last); } }); } }
public BoltKeyValue last() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Last(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void move_next() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored1 = boltTransaction.createBucket("test1".getBytes())) { try (BoltBucket ignored2 = boltTransaction.createBucket("test2".getBytes())) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue next = cursor.next(); Assert.assertNull(next); } } } }); } }
public BoltKeyValue next() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Next(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void move_prev() throws IOException { try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try (BoltBucket ignored1 = boltTransaction.createBucket("test1".getBytes())) { try (BoltBucket ignored2 = boltTransaction.createBucket("test2".getBytes())) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue prev = cursor.prev(); Assert.assertNull(prev); } } } }); } }
public BoltKeyValue prev() { try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Prev(objectId)) { return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null; } }
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 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); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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 first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void seek() throws IOException { byte[] bucketName1 = "test1".getBytes(); byte[] bucketName2 = "test2".getBytes(); byte[] bucketName3 = "test3".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try(BoltBucket ignored1 = boltTransaction.createBucket(bucketName1)) { try(BoltBucket ignored2 = boltTransaction.createBucket(bucketName2)) { try(BoltBucket ignored3 = boltTransaction.createBucket(bucketName3)) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue seek = cursor.seek(bucketName2); Assert.assertNotNull(seek); Assert.assertArrayEquals(bucketName2, seek.getKey()); } } } } }); } }
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 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 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); }
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); @Override void close(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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); @Override void close(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void seek_to_unknown_position() throws IOException { byte[] bucketName1 = "test1".getBytes(); byte[] bucketName2 = "test2".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try(BoltBucket ignored = boltTransaction.createBucket(bucketName1)) { try (BoltCursor cursor = boltTransaction.createCursor()) { BoltKeyValue seek = cursor.seek(bucketName2); Assert.assertNull(seek); } } }); } }
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 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 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); }
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); @Override void close(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
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); @Override void close(); BoltKeyValue first(); BoltKeyValue last(); BoltKeyValue next(); BoltKeyValue prev(); BoltKeyValue seek(byte[] seek); void delete(); }
@Test public void delete() throws IOException { byte[] bucketName = "test".getBytes(); try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) { bolt.update(boltTransaction -> { try(BoltBucket bucket = boltTransaction.createBucket(bucketName)) { byte[] key = "key".getBytes(); byte[] value = "value".getBytes(); bucket.put(key, value); try (BoltCursor cursor = bucket.createCursor()) { cursor.first(); cursor.delete(); } } }); } }
public void delete() { Error.ByValue error = BoltNative.BoltDBCursor_Delete(objectId); error.checkError(); }
BoltCursor implements AutoCloseable { public void delete() { Error.ByValue error = BoltNative.BoltDBCursor_Delete(objectId); error.checkError(); } }
BoltCursor implements AutoCloseable { public void delete() { Error.ByValue error = BoltNative.BoltDBCursor_Delete(objectId); error.checkError(); } BoltCursor(long objectId); }
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[] seek); void delete(); }
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[] seek); void delete(); }
@Test public void createTest() throws ApiException { CreateFlowRequest body = null; Flow response = api.create(body); }
public Flow create(CreateFlowRequest body) throws ApiException { ApiResponse<Flow> resp = createWithHttpInfo(body); return resp.getData(); }
FlowsApi { public Flow create(CreateFlowRequest body) throws ApiException { ApiResponse<Flow> resp = createWithHttpInfo(body); return resp.getData(); } }
FlowsApi { public Flow create(CreateFlowRequest body) throws ApiException { ApiResponse<Flow> resp = createWithHttpInfo(body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void createTest() throws ApiException { CreateFunctionRequest body = null; KFFunction response = api.create(body); }
public KFFunction create(CreateFunctionRequest body) throws ApiException { ApiResponse<KFFunction> resp = createWithHttpInfo(body); return resp.getData(); }
FunctionsApi { public KFFunction create(CreateFunctionRequest body) throws ApiException { ApiResponse<KFFunction> resp = createWithHttpInfo(body); return resp.getData(); } }
FunctionsApi { public KFFunction create(CreateFunctionRequest body) throws ApiException { ApiResponse<KFFunction> resp = createWithHttpInfo(body); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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 create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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 create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void deleteTest() throws ApiException { String id = null; api.delete(id); }
public void delete(String id) throws ApiException { deleteWithHttpInfo(id); }
FunctionsApi { public void delete(String id) throws ApiException { deleteWithHttpInfo(id); } }
FunctionsApi { public void delete(String id) throws ApiException { deleteWithHttpInfo(id); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void getTest() throws ApiException { String id = null; KFFunction response = api.get(id); }
public KFFunction get(String id) throws ApiException { ApiResponse<KFFunction> resp = getWithHttpInfo(id); return resp.getData(); }
FunctionsApi { public KFFunction get(String id) throws ApiException { ApiResponse<KFFunction> resp = getWithHttpInfo(id); return resp.getData(); } }
FunctionsApi { public KFFunction get(String id) throws ApiException { ApiResponse<KFFunction> resp = getWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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 body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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 body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void getServiceTest() throws ApiException { String id = null; Service response = api.getService(id); }
public Service getService(String id) throws ApiException { ApiResponse<Service> resp = getServiceWithHttpInfo(id); return resp.getData(); }
FunctionsApi { public Service getService(String id) throws ApiException { ApiResponse<Service> resp = getServiceWithHttpInfo(id); return resp.getData(); } }
FunctionsApi { public Service getService(String id) throws ApiException { ApiResponse<Service> resp = getServiceWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void getVersionTest() throws ApiException { String id = null; String versionId = null; Version response = api.getVersion(id, versionId); }
public Version getVersion(String id, String versionId) throws ApiException { ApiResponse<Version> resp = getVersionWithHttpInfo(id, versionId); return resp.getData(); }
FunctionsApi { public Version getVersion(String id, String versionId) throws ApiException { ApiResponse<Version> resp = getVersionWithHttpInfo(id, versionId); return resp.getData(); } }
FunctionsApi { public Version getVersion(String id, String versionId) throws ApiException { ApiResponse<Version> resp = getVersionWithHttpInfo(id, versionId); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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); KFFunction create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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); KFFunction create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void getVersionsTest() throws ApiException { String id = null; List<Version> response = api.getVersions(id); }
public List<Version> getVersions(String id) throws ApiException { ApiResponse<List<Version>> resp = getVersionsWithHttpInfo(id); return resp.getData(); }
FunctionsApi { public List<Version> getVersions(String id) throws ApiException { ApiResponse<List<Version>> resp = getVersionsWithHttpInfo(id); return resp.getData(); } }
FunctionsApi { public List<Version> getVersions(String id) throws ApiException { ApiResponse<List<Version>> resp = getVersionsWithHttpInfo(id); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void listTest() throws ApiException { List<KFFunction> response = api.list(); }
public List<KFFunction> list() throws ApiException { ApiResponse<List<KFFunction>> resp = listWithHttpInfo(); return resp.getData(); }
FunctionsApi { public List<KFFunction> list() throws ApiException { ApiResponse<List<KFFunction>> resp = listWithHttpInfo(); return resp.getData(); } }
FunctionsApi { public List<KFFunction> list() throws ApiException { ApiResponse<List<KFFunction>> resp = listWithHttpInfo(); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void proxyTest() throws ApiException { String id = null; String body = null; ProxyResponse response = api.proxy(id, body); }
public ProxyResponse proxy(String id, String body) throws ApiException { ApiResponse<ProxyResponse> resp = proxyWithHttpInfo(id, body); return resp.getData(); }
FunctionsApi { public ProxyResponse proxy(String id, String body) throws ApiException { ApiResponse<ProxyResponse> resp = proxyWithHttpInfo(id, body); return resp.getData(); } }
FunctionsApi { public ProxyResponse proxy(String id, String body) throws ApiException { ApiResponse<ProxyResponse> resp = proxyWithHttpInfo(id, body); return resp.getData(); } FunctionsApi(); FunctionsApi(ApiClient apiClient); }
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 create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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 create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void setVersionTest() throws ApiException { String id = null; String versionId = null; Map<String, String> response = api.setVersion(id, versionId); }
public Map<String, String> setVersion(String id, String versionId) throws ApiException { ApiResponse<Map<String, String>> resp = setVersionWithHttpInfo(id, versionId); return resp.getData(); }
FunctionsApi { public Map<String, String> setVersion(String id, String versionId) throws ApiException { ApiResponse<Map<String, String>> resp = setVersionWithHttpInfo(id, versionId); return resp.getData(); } }
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); }
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(ApiClient apiClient); KFFunction create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
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(ApiClient apiClient); KFFunction create(CreateFunctionRequest body); ApiResponse<KFFunction> createWithHttpInfo(CreateFunctionRequest body); com.squareup.okhttp.Call createAsync(CreateFunctionRequest body, final ApiCallback<KFFunction> callback); void delete(String id); ApiResponse<Void> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<Void> callback); KFFunction get(String id); ApiResponse<KFFunction> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<KFFunction> callback); Service getService(String id); ApiResponse<Service> getServiceWithHttpInfo(String id); com.squareup.okhttp.Call getServiceAsync(String id, final ApiCallback<Service> callback); Version getVersion(String id, String versionId); ApiResponse<Version> getVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call getVersionAsync(String id, String versionId, final ApiCallback<Version> callback); List<Version> getVersions(String id); ApiResponse<List<Version>> getVersionsWithHttpInfo(String id); com.squareup.okhttp.Call getVersionsAsync(String id, final ApiCallback<List<Version>> callback); List<KFFunction> list(); ApiResponse<List<KFFunction>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<KFFunction>> callback); ProxyResponse proxy(String id, String body); ApiResponse<ProxyResponse> proxyWithHttpInfo(String id, String body); com.squareup.okhttp.Call proxyAsync(String id, String body, final ApiCallback<ProxyResponse> callback); Map<String, String> setVersion(String id, String versionId); ApiResponse<Map<String, String>> setVersionWithHttpInfo(String id, String versionId); com.squareup.okhttp.Call setVersionAsync(String id, String versionId, final ApiCallback<Map<String, String>> callback); }
@Test public void deleteTest() throws ApiException { String id = null; String response = api.delete(id); }
public String delete(String id) throws ApiException { ApiResponse<String> resp = deleteWithHttpInfo(id); return resp.getData(); }
FlowsApi { public String delete(String id) throws ApiException { ApiResponse<String> resp = deleteWithHttpInfo(id); return resp.getData(); } }
FlowsApi { public String delete(String id) throws ApiException { ApiResponse<String> resp = deleteWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void deployTest() throws ApiException { String id = null; Flow response = api.deploy(id); }
public Flow deploy(String id) throws ApiException { ApiResponse<Flow> resp = deployWithHttpInfo(id); return resp.getData(); }
FlowsApi { public Flow deploy(String id) throws ApiException { ApiResponse<Flow> resp = deployWithHttpInfo(id); return resp.getData(); } }
FlowsApi { public Flow deploy(String id) throws ApiException { ApiResponse<Flow> resp = deployWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void getTest() throws ApiException { String id = null; Flow response = api.get(id); }
public Flow get(String id) throws ApiException { ApiResponse<Flow> resp = getWithHttpInfo(id); return resp.getData(); }
FlowsApi { public Flow get(String id) throws ApiException { ApiResponse<Flow> resp = getWithHttpInfo(id); return resp.getData(); } }
FlowsApi { public Flow get(String id) throws ApiException { ApiResponse<Flow> resp = getWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void getModelTest() throws ApiException { String id = null; DAGStepRef response = api.getModel(id); }
public DAGStepRef getModel(String id) throws ApiException { ApiResponse<DAGStepRef> resp = getModelWithHttpInfo(id); return resp.getData(); }
FlowsApi { public DAGStepRef getModel(String id) throws ApiException { ApiResponse<DAGStepRef> resp = getModelWithHttpInfo(id); return resp.getData(); } }
FlowsApi { public DAGStepRef getModel(String id) throws ApiException { ApiResponse<DAGStepRef> resp = getModelWithHttpInfo(id); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void listTest() throws ApiException { List<Flow> response = api.list(); }
public List<Flow> list() throws ApiException { ApiResponse<List<Flow>> resp = listWithHttpInfo(); return resp.getData(); }
FlowsApi { public List<Flow> list() throws ApiException { ApiResponse<List<Flow>> resp = listWithHttpInfo(); return resp.getData(); } }
FlowsApi { public List<Flow> list() throws ApiException { ApiResponse<List<Flow>> resp = listWithHttpInfo(); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void saveModelTest() throws ApiException { String id = null; Object body = null; String response = api.saveModel(id, body); }
public String saveModel(String id, Object body) throws ApiException { ApiResponse<String> resp = saveModelWithHttpInfo(id, body); return resp.getData(); }
FlowsApi { public String saveModel(String id, Object body) throws ApiException { ApiResponse<String> resp = saveModelWithHttpInfo(id, body); return resp.getData(); } }
FlowsApi { public String saveModel(String id, Object body) throws ApiException { ApiResponse<String> resp = saveModelWithHttpInfo(id, body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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 body); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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 body); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void validateTest() throws ApiException { Object body = null; String response = api.validate(body); }
public String validate(Object body) throws ApiException { ApiResponse<String> resp = validateWithHttpInfo(body); return resp.getData(); }
FlowsApi { public String validate(Object body) throws ApiException { ApiResponse<String> resp = validateWithHttpInfo(body); return resp.getData(); } }
FlowsApi { public String validate(Object body) throws ApiException { ApiResponse<String> resp = validateWithHttpInfo(body); return resp.getData(); } FlowsApi(); FlowsApi(ApiClient apiClient); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
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); ApiResponse<Flow> createWithHttpInfo(CreateFlowRequest body); com.squareup.okhttp.Call createAsync(CreateFlowRequest body, final ApiCallback<Flow> callback); String delete(String id); ApiResponse<String> deleteWithHttpInfo(String id); com.squareup.okhttp.Call deleteAsync(String id, final ApiCallback<String> callback); Flow deploy(String id); ApiResponse<Flow> deployWithHttpInfo(String id); com.squareup.okhttp.Call deployAsync(String id, final ApiCallback<Flow> callback); Flow get(String id); ApiResponse<Flow> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Flow> callback); DAGStepRef getModel(String id); ApiResponse<DAGStepRef> getModelWithHttpInfo(String id); com.squareup.okhttp.Call getModelAsync(String id, final ApiCallback<DAGStepRef> callback); List<Flow> list(); ApiResponse<List<Flow>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Flow>> callback); String saveModel(String id, Object body); ApiResponse<String> saveModelWithHttpInfo(String id, Object body); com.squareup.okhttp.Call saveModelAsync(String id, Object body, final ApiCallback<String> callback); String validate(Object body); ApiResponse<String> validateWithHttpInfo(Object body); com.squareup.okhttp.Call validateAsync(Object body, final ApiCallback<String> callback); }
@Test public void getTest() throws ApiException { String id = null; Connector response = api.get(id); }
public Connector get(String id) throws ApiException { ApiResponse<Connector> resp = getWithHttpInfo(id); return resp.getData(); }
ConnectorsApi { public Connector get(String id) throws ApiException { ApiResponse<Connector> resp = getWithHttpInfo(id); return resp.getData(); } }
ConnectorsApi { public Connector get(String id) throws ApiException { ApiResponse<Connector> resp = getWithHttpInfo(id); return resp.getData(); } ConnectorsApi(); ConnectorsApi(ApiClient apiClient); }
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<Connector> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Connector> callback); List<Connector> list(); ApiResponse<List<Connector>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Connector>> callback); }
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<Connector> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Connector> callback); List<Connector> list(); ApiResponse<List<Connector>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Connector>> callback); }
@Test public void listTest() throws ApiException { List<Connector> response = api.list(); }
public List<Connector> list() throws ApiException { ApiResponse<List<Connector>> resp = listWithHttpInfo(); return resp.getData(); }
ConnectorsApi { public List<Connector> list() throws ApiException { ApiResponse<List<Connector>> resp = listWithHttpInfo(); return resp.getData(); } }
ConnectorsApi { public List<Connector> list() throws ApiException { ApiResponse<List<Connector>> resp = listWithHttpInfo(); return resp.getData(); } ConnectorsApi(); ConnectorsApi(ApiClient apiClient); }
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<Connector> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Connector> callback); List<Connector> list(); ApiResponse<List<Connector>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Connector>> callback); }
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<Connector> getWithHttpInfo(String id); com.squareup.okhttp.Call getAsync(String id, final ApiCallback<Connector> callback); List<Connector> list(); ApiResponse<List<Connector>> listWithHttpInfo(); com.squareup.okhttp.Call listAsync(final ApiCallback<List<Connector>> callback); }
@Test public void estimateScanCostTest() throws IOException, DbException, TransactionAbortedException { Object[] ret; int[] ioCosts = new int[20]; int[] pageNums = new int[ioCosts.length]; for(int i = 0; i < ioCosts.length; ++i) { ioCosts[i] = 1; pageNums[i] = 3*(i+1); } double stats[] = getRandomTableScanCosts(pageNums, ioCosts); ret = SystemTestUtil.checkConstant(stats); Assert.assertEquals(ret[0], Boolean.FALSE); ret = SystemTestUtil.checkLinear(stats); Assert.assertEquals(ret[0], Boolean.TRUE); for(int i = 0; i < ioCosts.length; ++i) { ioCosts[i] = 10*(i + 1); pageNums[i] = 3; } stats = getRandomTableScanCosts(pageNums, ioCosts); ret = SystemTestUtil.checkConstant(stats); Assert.assertEquals(ret[0], Boolean.FALSE); ret = SystemTestUtil.checkLinear(stats); Assert.assertEquals(ret[0], Boolean.TRUE); for(int i = 0; i < ioCosts.length; ++i) { ioCosts[i] = 3*(i + 1); pageNums[i] = (i+1); } stats = getRandomTableScanCosts(pageNums, ioCosts); ret = SystemTestUtil.checkConstant(stats); Assert.assertEquals(ret[0], Boolean.FALSE); ret = SystemTestUtil.checkLinear(stats); Assert.assertEquals(ret[0], Boolean.FALSE); ret = SystemTestUtil.checkQuadratic(stats); Assert.assertEquals(ret[0], Boolean.TRUE); }
public double estimateScanCost() { return table.numPages() * ioCostPerPage; }
TableStats { public double estimateScanCost() { return table.numPages() * ioCostPerPage; } }
TableStats { public double estimateScanCost() { return table.numPages() * ioCostPerPage; } TableStats(int tableid, int ioCostPerPage); }
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); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
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); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
@Test public void rewind() throws Exception { JoinPredicate pred = new JoinPredicate(0, Predicate.Op.EQUALS, 0); Join op = new Join(pred, scan1, scan2); op.open(); while (op.hasNext()) { assertNotNull(op.next()); } assertTrue(TestUtil.checkExhausted(op)); op.rewind(); eqJoin.open(); Tuple expected = eqJoin.next(); Tuple actual = op.next(); assertTrue(TestUtil.compareTuples(expected, actual)); }
public void rewind() throws DbException, TransactionAbortedException { child1.rewind(); child2.rewind(); joinResults.rewind(); }
Join extends Operator { public void rewind() throws DbException, TransactionAbortedException { child1.rewind(); child2.rewind(); joinResults.rewind(); } }
Join extends Operator { public void rewind() throws DbException, TransactionAbortedException { child1.rewind(); child2.rewind(); joinResults.rewind(); } Join(JoinPredicate p, DbIterator child1, DbIterator child2); }
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(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); }
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(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); static final int blockMemory; }
@Test public void gtJoin() throws Exception { JoinPredicate pred = new JoinPredicate(0, Predicate.Op.GREATER_THAN, 0); Join op = new Join(pred, scan1, scan2); op.open(); gtJoin.open(); TestUtil.matchAllTuples(gtJoin, op); }
public void open() throws DbException, NoSuchElementException, TransactionAbortedException { child1.open(); child2.open(); super.open(); joinResults = blockNestedLoopJoin(); joinResults.open(); }
Join extends Operator { public void open() throws DbException, NoSuchElementException, TransactionAbortedException { child1.open(); child2.open(); super.open(); joinResults = blockNestedLoopJoin(); joinResults.open(); } }
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); }
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(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); }
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(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); static final int blockMemory; }
@Test public void eqJoin() throws Exception { JoinPredicate pred = new JoinPredicate(0, Predicate.Op.EQUALS, 0); Join op = new Join(pred, scan1, scan2); op.open(); eqJoin.open(); TestUtil.matchAllTuples(eqJoin, op); }
public void open() throws DbException, NoSuchElementException, TransactionAbortedException { child1.open(); child2.open(); super.open(); joinResults = blockNestedLoopJoin(); joinResults.open(); }
Join extends Operator { public void open() throws DbException, NoSuchElementException, TransactionAbortedException { child1.open(); child2.open(); super.open(); joinResults = blockNestedLoopJoin(); joinResults.open(); } }
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); }
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(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); }
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(); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); static final int blockMemory; }
@Test public void estimateTableCardinalityTest() { TableStats s = new TableStats(this.tableId, IO_COST); Assert.assertEquals(306, s.estimateTableCardinality(0.3)); Assert.assertEquals(1020, s.estimateTableCardinality(1.0)); Assert.assertEquals(0, s.estimateTableCardinality(0.0)); }
public int estimateTableCardinality(double selectivityFactor) { return (int) Math.ceil(totalTuples() * selectivityFactor); }
TableStats { public int estimateTableCardinality(double selectivityFactor) { return (int) Math.ceil(totalTuples() * selectivityFactor); } }
TableStats { public int estimateTableCardinality(double selectivityFactor) { return (int) Math.ceil(totalTuples() * selectivityFactor); } TableStats(int tableid, int ioCostPerPage); }
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 void setStatsMap(HashMap<String, TableStats> s); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
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 void setStatsMap(HashMap<String, TableStats> s); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
@Test public void estimateSelectivityTest() { final int maxCellVal = 32; final Field aboveMax = new IntField(maxCellVal + 10); final Field atMax = new IntField(maxCellVal); final Field halfMaxMin = new IntField(maxCellVal/2); final Field atMin = new IntField(0); final Field belowMin = new IntField(-10); TableStats s = new TableStats(this.tableId, IO_COST); for (int col = 0; col < 10; col++) { Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.EQUALS, aboveMax), 0.001); Assert.assertEquals(1.0/32.0, s.estimateSelectivity(col, Predicate.Op.EQUALS, halfMaxMin), 0.015); Assert.assertEquals(0, s.estimateSelectivity(col, Predicate.Op.EQUALS, belowMin), 0.001); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.NOT_EQUALS, aboveMax), 0.001); Assert.assertEquals(31.0/32.0, s.estimateSelectivity(col, Predicate.Op.NOT_EQUALS, halfMaxMin), 0.015); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.NOT_EQUALS, belowMin), 0.015); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN, aboveMax), 0.001); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN, atMax), 0.001); Assert.assertEquals(0.5, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN, halfMaxMin), 0.1); Assert.assertEquals(31.0/32.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN, atMin), 0.05); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN, belowMin), 0.001); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN, aboveMax), 0.001); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN, atMax), 0.015); Assert.assertEquals(0.5, s.estimateSelectivity(col, Predicate.Op.LESS_THAN, halfMaxMin), 0.1); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN, atMin), 0.001); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN, belowMin), 0.001); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN_OR_EQ, aboveMax), 0.001); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN_OR_EQ, atMax), 0.015); Assert.assertEquals(0.5, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN_OR_EQ, halfMaxMin), 0.1); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN_OR_EQ, atMin), 0.015); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.GREATER_THAN_OR_EQ, belowMin), 0.001); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN_OR_EQ, aboveMax), 0.001); Assert.assertEquals(1.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN_OR_EQ, atMax), 0.015); Assert.assertEquals(0.5, s.estimateSelectivity(col, Predicate.Op.LESS_THAN_OR_EQ, halfMaxMin), 0.1); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN_OR_EQ, atMin), 0.05); Assert.assertEquals(0.0, s.estimateSelectivity(col, Predicate.Op.LESS_THAN_OR_EQ, belowMin), 0.001); } }
public double estimateSelectivity(int field, Predicate.Op op, Field constant) { String fieldName = td.getFieldName(field); if (constant.getType() == Type.INT_TYPE) { int value = ((IntField)constant).getValue(); IntHistogram histogram = (IntHistogram) name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } else { String value = ((StringField)constant).getValue(); StringHistogram histogram = (StringHistogram)name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } }
TableStats { public double estimateSelectivity(int field, Predicate.Op op, Field constant) { String fieldName = td.getFieldName(field); if (constant.getType() == Type.INT_TYPE) { int value = ((IntField)constant).getValue(); IntHistogram histogram = (IntHistogram) name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } else { String value = ((StringField)constant).getValue(); StringHistogram histogram = (StringHistogram)name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } } }
TableStats { public double estimateSelectivity(int field, Predicate.Op op, Field constant) { String fieldName = td.getFieldName(field); if (constant.getType() == Type.INT_TYPE) { int value = ((IntField)constant).getValue(); IntHistogram histogram = (IntHistogram) name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } else { String value = ((StringField)constant).getValue(); StringHistogram histogram = (StringHistogram)name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } } TableStats(int tableid, int ioCostPerPage); }
TableStats { public double estimateSelectivity(int field, Predicate.Op op, Field constant) { String fieldName = td.getFieldName(field); if (constant.getType() == Type.INT_TYPE) { int value = ((IntField)constant).getValue(); IntHistogram histogram = (IntHistogram) name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } else { String value = ((StringField)constant).getValue(); StringHistogram histogram = (StringHistogram)name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } } TableStats(int tableid, int ioCostPerPage); static TableStats getTableStats(String tablename); static void setTableStats(String tablename, TableStats stats); static void setStatsMap(HashMap<String, TableStats> s); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
TableStats { public double estimateSelectivity(int field, Predicate.Op op, Field constant) { String fieldName = td.getFieldName(field); if (constant.getType() == Type.INT_TYPE) { int value = ((IntField)constant).getValue(); IntHistogram histogram = (IntHistogram) name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } else { String value = ((StringField)constant).getValue(); StringHistogram histogram = (StringHistogram)name2hist.get(fieldName); return histogram.estimateSelectivity(op, value); } } TableStats(int tableid, int ioCostPerPage); static TableStats getTableStats(String tablename); static void setTableStats(String tablename, TableStats stats); static void setStatsMap(HashMap<String, TableStats> s); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, simpledb.Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples(); }
@Test public void estimateJoinCostTest() throws ParsingException { TransactionId tid = new TransactionId(); JoinOptimizer jo; Parser p = new Parser(); String t1Alia = "t1"; String t2Alia = "t2"; jo = new JoinOptimizer(p.generateLogicalPlan(tid, "SELECT * FROM " + tableName1 + " t1, " + tableName2 + " t2 WHERE t1.c1 = t2.c2;"), new Vector<LogicalJoinNode>()); LogicalJoinNode equalsJoinNode = new LogicalJoinNode(t1Alia, t2Alia, Integer.toString(1), Integer.toString(2), Predicate.Op.EQUALS); checkJoinEstimateCosts(jo, equalsJoinNode); jo = new JoinOptimizer(p.generateLogicalPlan(tid, "SELECT * FROM " + tableName1 + " t1, " + tableName2 + " t2 WHERE t1.c1 = t2.c2;"), new Vector<LogicalJoinNode>()); equalsJoinNode = new LogicalJoinNode(t2Alia, t1Alia, Integer.toString(2), Integer.toString(1), Predicate.Op.EQUALS); checkJoinEstimateCosts(jo, equalsJoinNode); jo = new JoinOptimizer(p.generateLogicalPlan(tid, "SELECT * FROM " + tableName1 + " t1, " + tableName1 + " t2 WHERE t1.c3 = t2.c4;"), new Vector<LogicalJoinNode>()); equalsJoinNode = new LogicalJoinNode(t1Alia, t1Alia, Integer.toString(3), Integer.toString(4), Predicate.Op.EQUALS); checkJoinEstimateCosts(jo, equalsJoinNode); jo = new JoinOptimizer(p.generateLogicalPlan(tid, "SELECT * FROM " + tableName2 + " t1, " + tableName2 + " t2 WHERE t1.c8 = t2.c7;"), new Vector<LogicalJoinNode>()); equalsJoinNode = new LogicalJoinNode(t2Alia, t2Alia, Integer.toString(8), Integer.toString(7), Predicate.Op.EQUALS); checkJoinEstimateCosts(jo, equalsJoinNode); }
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 = card1 / blockSize; int left = (card1 - blockSize * fullNum) == 0 ? 0 : 1; int blockCard = fullNum + left; double cost = cost1 + blockCard * cost2 + (double) card1 * (double) card2; return cost; } }
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 = card1 / blockSize; int left = (card1 - blockSize * fullNum) == 0 ? 0 : 1; int blockCard = fullNum + left; double cost = cost1 + blockCard * cost2 + (double) card1 * (double) card2; return cost; } } }
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 = card1 / blockSize; int left = (card1 - blockSize * fullNum) == 0 ? 0 : 1; int blockCard = fullNum + left; double cost = cost1 + blockCard * cost2 + (double) card1 * (double) card2; return cost; } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); }
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 = card1 / blockSize; int left = (card1 - blockSize * fullNum) == 0 ? 0 : 1; int blockCard = fullNum + left; double cost = cost1 + blockCard * cost2 + (double) card1 * (double) card2; return cost; } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
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 = card1 / blockSize; int left = (card1 - blockSize * fullNum) == 0 ? 0 : 1; int blockCard = fullNum + left; double cost = cost1 + blockCard * cost2 + (double) card1 * (double) card2; return cost; } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
@Test public void estimateJoinCardinality() throws ParsingException { TransactionId tid = new TransactionId(); Parser p = new Parser(); JoinOptimizer j = new JoinOptimizer(p.generateLogicalPlan(tid, "SELECT * FROM " + tableName2 + " t1, " + tableName2 + " t2 WHERE t1.c8 = t2.c7;"), new Vector<LogicalJoinNode>()); double cardinality; cardinality = j.estimateJoinCardinality(new LogicalJoinNode("t1", "t2", "c"+Integer.toString(3), "c"+Integer.toString(4), Predicate.Op.EQUALS), stats1.estimateTableCardinality(0.8), stats2.estimateTableCardinality(0.2), true, false, TableStats.getStatsMap()); Assert.assertTrue(cardinality == 800 || cardinality == 2000); cardinality = j.estimateJoinCardinality(new LogicalJoinNode("t1", "t2", "c"+Integer.toString(3), "c"+Integer.toString(4), Predicate.Op.EQUALS), stats1.estimateTableCardinality(0.8), stats2.estimateTableCardinality(0.2), false, true,TableStats.getStatsMap()); Assert.assertTrue(cardinality == 800 || cardinality == 2000); }
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.f2PureName, card1, card2, t1pkey, t2pkey, stats, p.getTableAliasToIdMapping()); } }
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.f2PureName, card1, card2, t1pkey, t2pkey, stats, p.getTableAliasToIdMapping()); } } }
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.f2PureName, card1, card2, t1pkey, t2pkey, stats, p.getTableAliasToIdMapping()); } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); }
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.f2PureName, card1, card2, t1pkey, t2pkey, stats, p.getTableAliasToIdMapping()); } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
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.f2PureName, card1, card2, t1pkey, t2pkey, stats, p.getTableAliasToIdMapping()); } } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
@Test public void orderJoinsTest() throws ParsingException, IOException, DbException, TransactionAbortedException { final int IO_COST = 101; TransactionId tid = new TransactionId(); JoinOptimizer j; Vector<LogicalJoinNode> result; Vector<LogicalJoinNode> nodes = new Vector<LogicalJoinNode>(); HashMap<String, TableStats> stats = new HashMap<String, TableStats>(); HashMap<String, Double> filterSelectivities = new HashMap<String, Double>(); ArrayList<ArrayList<Integer>> empTuples = new ArrayList<ArrayList<Integer>>(); HeapFile emp = SystemTestUtil.createRandomHeapFile(6, 100000, null, empTuples, "c"); Database.getCatalog().addTable(emp, "emp"); ArrayList<ArrayList<Integer>> deptTuples = new ArrayList<ArrayList<Integer>>(); HeapFile dept = SystemTestUtil.createRandomHeapFile(3, 1000, null, deptTuples, "c"); Database.getCatalog().addTable(dept, "dept"); ArrayList<ArrayList<Integer>> hobbyTuples = new ArrayList<ArrayList<Integer>>(); HeapFile hobby = SystemTestUtil.createRandomHeapFile(6, 1000, null, hobbyTuples, "c"); Database.getCatalog().addTable(hobby, "hobby"); ArrayList<ArrayList<Integer>> hobbiesTuples = new ArrayList<ArrayList<Integer>>(); HeapFile hobbies = SystemTestUtil.createRandomHeapFile(2, 200000, null, hobbiesTuples, "c"); Database.getCatalog().addTable(hobbies, "hobbies"); stats.put("emp", new TableStats(Database.getCatalog().getTableId("emp"), IO_COST)); stats.put("dept", new TableStats(Database.getCatalog().getTableId("dept"), IO_COST)); stats.put("hobby", new TableStats(Database.getCatalog().getTableId("hobby"), IO_COST)); stats.put("hobbies", new TableStats(Database.getCatalog().getTableId("hobbies"), IO_COST)); filterSelectivities.put("emp", 0.1); filterSelectivities.put("dept", 1.0); filterSelectivities.put("hobby", 1.0); filterSelectivities.put("hobbies", 1.0); nodes.add(new LogicalJoinNode("hobbies", "hobby", "c1", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("emp", "dept", "c1", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("emp", "hobbies", "c2", "c0", Predicate.Op.EQUALS)); Parser p = new Parser(); j = new JoinOptimizer( p.generateLogicalPlan(tid, "SELECT * FROM emp,dept,hobbies,hobby WHERE emp.c1 = dept.c0 AND hobbies.c0 = emp.c2 AND hobbies.c1 = hobby.c0 AND e.c3 < 1000;"), nodes); result = j.orderJoins(stats, filterSelectivities, false); Assert.assertEquals(result.size(), nodes.size()); Assert.assertFalse(result.get(0).t1Alias == "hobbies"); Assert.assertFalse(result.get(2).t2Alias == "hobbies" && (result.get(0).t1Alias == "hobbies" || result.get(0).t2Alias == "hobbies")); }
public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
@Test(timeout=60000) public void bigOrderJoinsTest() throws IOException, DbException, TransactionAbortedException, ParsingException { final int IO_COST = 103; JoinOptimizer j; HashMap<String, TableStats> stats = new HashMap<String,TableStats>(); Vector<LogicalJoinNode> result; Vector<LogicalJoinNode> nodes = new Vector<LogicalJoinNode>(); HashMap<String, Double> filterSelectivities = new HashMap<String, Double>(); TransactionId tid = new TransactionId(); ArrayList<ArrayList<Integer>> smallHeapFileTuples = new ArrayList<ArrayList<Integer>>(); HeapFile smallHeapFileA = SystemTestUtil.createRandomHeapFile(2, 100, Integer.MAX_VALUE, null, smallHeapFileTuples, "c"); HeapFile smallHeapFileB = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileC = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileD = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileE = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileF = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileG = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileH = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileI = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileJ = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileK = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileL = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileM = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileN = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); ArrayList<ArrayList<Integer>> bigHeapFileTuples = new ArrayList<ArrayList<Integer>>(); for (int i = 0; i < 100000; i++) { bigHeapFileTuples.add( smallHeapFileTuples.get( i%100 ) ); } HeapFile bigHeapFile = createDuplicateHeapFile(bigHeapFileTuples, 2, "c"); Database.getCatalog().addTable(bigHeapFile, "bigTable"); Database.getCatalog().addTable(smallHeapFileA, "a"); Database.getCatalog().addTable(smallHeapFileB, "b"); Database.getCatalog().addTable(smallHeapFileC, "c"); Database.getCatalog().addTable(smallHeapFileD, "d"); Database.getCatalog().addTable(smallHeapFileE, "e"); Database.getCatalog().addTable(smallHeapFileF, "f"); Database.getCatalog().addTable(smallHeapFileG, "g"); Database.getCatalog().addTable(smallHeapFileH, "h"); Database.getCatalog().addTable(smallHeapFileI, "i"); Database.getCatalog().addTable(smallHeapFileJ, "j"); Database.getCatalog().addTable(smallHeapFileK, "k"); Database.getCatalog().addTable(smallHeapFileL, "l"); Database.getCatalog().addTable(smallHeapFileM, "m"); Database.getCatalog().addTable(smallHeapFileN, "n"); stats.put("bigTable", new TableStats(bigHeapFile.getId(), IO_COST)); stats.put("a", new TableStats(smallHeapFileA.getId(), IO_COST)); stats.put("b", new TableStats(smallHeapFileB.getId(), IO_COST)); stats.put("c", new TableStats(smallHeapFileC.getId(), IO_COST)); stats.put("d", new TableStats(smallHeapFileD.getId(), IO_COST)); stats.put("e", new TableStats(smallHeapFileE.getId(), IO_COST)); stats.put("f", new TableStats(smallHeapFileF.getId(), IO_COST)); stats.put("g", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("h", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("i", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("j", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("k", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("l", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("m", new TableStats(smallHeapFileG.getId(), IO_COST)); stats.put("n", new TableStats(smallHeapFileG.getId(), IO_COST)); filterSelectivities.put("bigTable", 1.0); filterSelectivities.put("a", 1.0); filterSelectivities.put("b", 1.0); filterSelectivities.put("c", 1.0); filterSelectivities.put("d", 1.0); filterSelectivities.put("e", 1.0); filterSelectivities.put("f", 1.0); filterSelectivities.put("g", 1.0); filterSelectivities.put("h", 1.0); filterSelectivities.put("i", 1.0); filterSelectivities.put("j", 1.0); filterSelectivities.put("k", 1.0); filterSelectivities.put("l", 1.0); filterSelectivities.put("m", 1.0); filterSelectivities.put("n", 1.0); nodes.add(new LogicalJoinNode("a", "b", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("b", "c", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("c", "d", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("d", "e", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("e", "f", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("f", "g", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("g", "h", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("h", "i", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("i", "j", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("j", "k", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("k", "l", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("l", "m", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("m", "n", "c1", "c1", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("n", "bigTable", "c0", "c0", Predicate.Op.EQUALS)); Collections.shuffle(nodes); Parser p = new Parser(); j = new JoinOptimizer( p.generateLogicalPlan(tid, "SELECT COUNT(a.c0) FROM bigTable, a, b, c, d, e, f, g, h, i, j, k, l, m, n WHERE bigTable.c0 = n.c0 AND a.c1 = b.c1 AND b.c0 = c.c0 AND c.c1 = d.c1 AND d.c0 = e.c0 AND e.c1 = f.c1 AND f.c0 = g.c0 AND g.c1 = h.c1 AND h.c0 = i.c0 AND i.c1 = j.c1 AND j.c0 = k.c0 AND k.c1 = l.c1 AND l.c0 = m.c0 AND m.c1 = n.c1;"), nodes); result = j.orderJoins(stats, filterSelectivities, false); Assert.assertEquals(result.size(), nodes.size()); Assert.assertEquals(result.get(result.size()-1).t2Alias, "bigTable"); }
public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
@Test public void nonequalityOrderJoinsTest() throws IOException, DbException, TransactionAbortedException, ParsingException { final int IO_COST = 103; JoinOptimizer j; HashMap<String, TableStats> stats = new HashMap<String,TableStats>(); Vector<LogicalJoinNode> result; Vector<LogicalJoinNode> nodes = new Vector<LogicalJoinNode>(); HashMap<String, Double> filterSelectivities = new HashMap<String, Double>(); TransactionId tid = new TransactionId(); ArrayList<ArrayList<Integer>> smallHeapFileTuples = new ArrayList<ArrayList<Integer>>(); HeapFile smallHeapFileA = SystemTestUtil.createRandomHeapFile(2, 100, Integer.MAX_VALUE, null, smallHeapFileTuples, "c"); HeapFile smallHeapFileB = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileC = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); HeapFile smallHeapFileD = createDuplicateHeapFile(smallHeapFileTuples, 2, "c"); Database.getCatalog().addTable(smallHeapFileA, "a"); Database.getCatalog().addTable(smallHeapFileB, "b"); Database.getCatalog().addTable(smallHeapFileC, "c"); Database.getCatalog().addTable(smallHeapFileD, "d"); stats.put("a", new TableStats(smallHeapFileA.getId(), IO_COST)); stats.put("b", new TableStats(smallHeapFileB.getId(), IO_COST)); stats.put("c", new TableStats(smallHeapFileC.getId(), IO_COST)); stats.put("d", new TableStats(smallHeapFileD.getId(), IO_COST)); filterSelectivities.put("a", 1.0); filterSelectivities.put("b", 1.0); filterSelectivities.put("c", 1.0); filterSelectivities.put("d", 1.0); nodes.add(new LogicalJoinNode("a", "b", "c1", "c1", Predicate.Op.LESS_THAN)); nodes.add(new LogicalJoinNode("b", "c", "c0", "c0", Predicate.Op.EQUALS)); nodes.add(new LogicalJoinNode("c", "d", "c1", "c1", Predicate.Op.EQUALS)); Parser p = new Parser(); j = new JoinOptimizer( p.generateLogicalPlan(tid, "SELECT COUNT(a.c0) FROM a, b, c, d WHERE a.c1 < b.c1 AND b.c0 = c.c0 AND c.c1 = d.c1;"), nodes); result = j.orderJoins(stats, filterSelectivities, false); Assert.assertEquals(result.size(), nodes.size()); Assert.assertTrue(result.get(result.size() - 1).t2Alias.equals("a") || result.get(result.size() - 1).t1Alias.equals("a")); }
public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
JoinOptimizer { public Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain) throws ParsingException { int numJoinNodes = joins.size(); PlanCache pc = new PlanCache(); Set<LogicalJoinNode> wholeSet = null; for (int i = 1; i <= numJoinNodes; i++) { Set<Set<LogicalJoinNode>> setOfSubset = this.enumerateSubsets(this.joins, i); for (Set<LogicalJoinNode> s : setOfSubset) { if (s.size() == numJoinNodes) { wholeSet = s; } Double bestCostSofar = Double.MAX_VALUE; CostCard bestPlan = new CostCard(); for (LogicalJoinNode toRemove : s) { CostCard plan = computeCostAndCardOfSubplan(stats, filterSelectivities, toRemove, s, bestCostSofar, pc); if (plan != null) { bestCostSofar = plan.cost; bestPlan = plan; } } if (bestPlan.plan != null) { pc.addPlan(s, bestPlan.cost, bestPlan.card, bestPlan.plan); } } } return pc.getOrder(wholeSet); } JoinOptimizer(LogicalPlan p, Vector<LogicalJoinNode> joins); static DbIterator instantiateJoin(LogicalJoinNode lj, DbIterator plan1, DbIterator plan2); double estimateJoinCost(LogicalJoinNode j, int card1, int card2, double cost1, double cost2); int estimateJoinCardinality(LogicalJoinNode j, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats); static int estimateTableJoinCardinality(Predicate.Op joinOp, String table1Alias, String table2Alias, String field1PureName, String field2PureName, int card1, int card2, boolean t1pkey, boolean t2pkey, Map<String, TableStats> stats, Map<String, Integer> tableAliasToId); @SuppressWarnings("unchecked") Set<Set<T>> enumerateSubsets(Vector<T> v, int size); Vector<LogicalJoinNode> orderJoins( HashMap<String, TableStats> stats, HashMap<String, Double> filterSelectivities, boolean explain); }
@Test public void attemptTransactionTwice() throws Exception { bp.getPage(tid1, p0, Permissions.READ_ONLY); bp.getPage(tid1, p1, Permissions.READ_WRITE); bp.transactionComplete(tid1, true); bp.getPage(tid2, p0, Permissions.READ_WRITE); bp.getPage(tid2, p0, Permissions.READ_WRITE); }
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); } catch (IOException e) { e.printStackTrace(); } started = false; } }
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); } catch (IOException e) { e.printStackTrace(); } started = false; } } }
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); } catch (IOException e) { e.printStackTrace(); } started = false; } } Transaction(); }
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); } catch (IOException e) { e.printStackTrace(); } started = false; } } Transaction(); void start(); TransactionId getId(); void commit(); void abort(); void transactionComplete(boolean abort); }
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); } catch (IOException e) { e.printStackTrace(); } started = false; } } Transaction(); void start(); TransactionId getId(); void commit(); void abort(); void transactionComplete(boolean abort); }
@Test public void getTupleDesc() { JoinPredicate pred = new JoinPredicate(0, Predicate.Op.EQUALS, 0); Join op = new Join(pred, scan1, scan2); TupleDesc expected = Utility.getTupleDesc(width1 + width2); TupleDesc actual = op.getTupleDesc(); assertEquals(expected, actual); }
public TupleDesc getTupleDesc() { return td; }
Join extends Operator { public TupleDesc getTupleDesc() { return td; } }
Join extends Operator { public TupleDesc getTupleDesc() { return td; } Join(JoinPredicate p, DbIterator child1, DbIterator child2); }
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(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); }
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(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); static final int blockMemory; }
@Test public void getUserApprovedCommentPosts() throws Exception { Page<CommentPost> page = new PageImpl<CommentPost>(getTestApprovedCommentPostList(), new PageRequest(0, 10), 2); when(commentPostRepositoryMock.findByAuthorIdAndStatusOrderByCreatedTimeDesc( eq(USER_ID), eq(CommentStatusType.APPROVED), any(Pageable.class))) .thenReturn(page); mockMvc.perform(get(ApiUrls.API_ROOT + ApiUrls.URL_SITE_PROFILES_USER_COMMENTS, USER_ID)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaTypes.HAL_JSON)) .andExpect(jsonPath("$._embedded.commentPostList", hasSize(2))) .andExpect(jsonPath("$._embedded.commentPostList[0].id", is(COMMENTS_1_ID))) .andExpect(jsonPath("$._embedded.commentPostList[0].blogPostId", is(BLOG_ID))) .andExpect(jsonPath("$._embedded.commentPostList[0].authorId", is(COMMENTS_1_AUTHOR_ID))) .andExpect(jsonPath("$._embedded.commentPostList[0].content", is (COMMENTS_1_CONTENT))) .andExpect(jsonPath("$._embedded.commentPostList[1].id", is(COMMENTS_2_ID))) .andExpect(jsonPath("$._embedded.commentPostList[1].blogPostId", is(BLOG_ID))) .andExpect(jsonPath("$._embedded.commentPostList[1].authorId", is(COMMENTS_2_AUTHOR_ID))) .andExpect(jsonPath("$._embedded.commentPostList[1].content", is(COMMENTS_2_CONTENT))) .andExpect(jsonPath("$._links.self.templated", is(true))) .andExpect(jsonPath("$._links.self.href", endsWith("/comments{?page,size,sort}"))) .andExpect(jsonPath("$.page.size", is(10))) .andExpect(jsonPath("$.page.totalElements", is(2))) .andExpect(jsonPath("$.page.totalPages", is(1))) .andExpect(jsonPath("$.page.number", is(0))) ; verify(commentPostRepositoryMock, times(1)).findByAuthorIdAndStatusOrderByCreatedTimeDesc( eq(USER_ID), eq(CommentStatusType.APPROVED), any(Pageable.class)); verifyNoMoreInteractions(commentPostRepositoryMock); }
@RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) public HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler) throws ResourceNotFoundException { Page<CommentPost> commentPosts = this.commentPostRepository.findByAuthorIdAndStatusOrderByCreatedTimeDesc( userId, CommentStatusType.APPROVED, pageable); return new ResponseEntity<>(assembler.toResource(commentPosts, publicCommentResourceAssembler), HttpStatus.OK); }
WebsiteRestController { @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) public HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler) throws ResourceNotFoundException { Page<CommentPost> commentPosts = this.commentPostRepository.findByAuthorIdAndStatusOrderByCreatedTimeDesc( userId, CommentStatusType.APPROVED, pageable); return new ResponseEntity<>(assembler.toResource(commentPosts, publicCommentResourceAssembler), HttpStatus.OK); } }
WebsiteRestController { @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) public HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler) throws ResourceNotFoundException { Page<CommentPost> commentPosts = this.commentPostRepository.findByAuthorIdAndStatusOrderByCreatedTimeDesc( userId, CommentStatusType.APPROVED, pageable); return new ResponseEntity<>(assembler.toResource(commentPosts, publicCommentResourceAssembler), HttpStatus.OK); } @Inject WebsiteRestController( UserAccountService userAccountService, UserAccountRepository userAccountRepository, BlogPostRepository blogPostRepository, CommentPostRepository commentPostRepository, MessageSender messageSender, WebsiteResourceAssembler websiteResourceAssembler, PublicBlogResourceAssembler publicBlogResourceAssembler, PublicCommentResourceAssembler publicCommentResourceAssembler, UserProfileResourceAssembler userProfileResourceAssembler); }
WebsiteRestController { @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) public HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler) throws ResourceNotFoundException { Page<CommentPost> commentPosts = this.commentPostRepository.findByAuthorIdAndStatusOrderByCreatedTimeDesc( userId, CommentStatusType.APPROVED, pageable); return new ResponseEntity<>(assembler.toResource(commentPosts, publicCommentResourceAssembler), HttpStatus.OK); } @Inject WebsiteRestController( UserAccountService userAccountService, UserAccountRepository userAccountRepository, BlogPostRepository blogPostRepository, CommentPostRepository commentPostRepository, MessageSender messageSender, WebsiteResourceAssembler websiteResourceAssembler, PublicBlogResourceAssembler publicBlogResourceAssembler, PublicCommentResourceAssembler publicCommentResourceAssembler, UserProfileResourceAssembler userProfileResourceAssembler); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE) HttpEntity<WebsiteResource> getPublicWebsiteResource(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_CURRENT_USER) HttpEntity<Resource<UserAccount>> getCurrentUserAccount(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER) HttpEntity<UserProfileResource> getUserProfile(@PathVariable("userId") String userId); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_LATEST_BLOG) HttpEntity<PublicBlogResource> getLatestBlogPost(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_RECENT_BLOGS) HttpEntity<Resources<PublicBlogResource>> getRecentPublicBlogPosts(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_RECENT_COMMENTS) HttpEntity<Resources<Resource<CommentPost>>> getRecentPublicCommentPosts(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_TAG_CLOUDS) HttpEntity<TagCloud[]> getTagCloud(); @RequestMapping(method = RequestMethod.POST, value = ApiUrls.URL_SITE_CONTACT) @ResponseBody String submitContactMessage(@RequestBody ContactForm contactForm); }
WebsiteRestController { @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) public HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler) throws ResourceNotFoundException { Page<CommentPost> commentPosts = this.commentPostRepository.findByAuthorIdAndStatusOrderByCreatedTimeDesc( userId, CommentStatusType.APPROVED, pageable); return new ResponseEntity<>(assembler.toResource(commentPosts, publicCommentResourceAssembler), HttpStatus.OK); } @Inject WebsiteRestController( UserAccountService userAccountService, UserAccountRepository userAccountRepository, BlogPostRepository blogPostRepository, CommentPostRepository commentPostRepository, MessageSender messageSender, WebsiteResourceAssembler websiteResourceAssembler, PublicBlogResourceAssembler publicBlogResourceAssembler, PublicCommentResourceAssembler publicCommentResourceAssembler, UserProfileResourceAssembler userProfileResourceAssembler); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE) HttpEntity<WebsiteResource> getPublicWebsiteResource(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_CURRENT_USER) HttpEntity<Resource<UserAccount>> getCurrentUserAccount(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER) HttpEntity<UserProfileResource> getUserProfile(@PathVariable("userId") String userId); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_PROFILES_USER_COMMENTS) HttpEntity<PagedResources<PublicCommentResource>> getUserApprovedCommentPosts( @PathVariable("userId") String userId, @PageableDefault(size = UtilConstants.DEFAULT_RETURN_RECORD_COUNT, page = 0) Pageable pageable, PagedResourcesAssembler<CommentPost> assembler); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_LATEST_BLOG) HttpEntity<PublicBlogResource> getLatestBlogPost(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_RECENT_BLOGS) HttpEntity<Resources<PublicBlogResource>> getRecentPublicBlogPosts(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_RECENT_COMMENTS) HttpEntity<Resources<Resource<CommentPost>>> getRecentPublicCommentPosts(); @RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_SITE_TAG_CLOUDS) HttpEntity<TagCloud[]> getTagCloud(); @RequestMapping(method = RequestMethod.POST, value = ApiUrls.URL_SITE_CONTACT) @ResponseBody String submitContactMessage(@RequestBody ContactForm contactForm); static final int MOST_RECENT_NUMBER; }
@Test public void testIsAuthor() { UserAccount normalUser = new UserAccount(); assertFalse(normalUser.isAuthor()); UserRoleType[] roles = new UserRoleType[]{UserRoleType.ROLE_USER, UserRoleType.ROLE_AUTHOR}; UserAccount author = new UserAccount("1234", roles); assertTrue(author.isAuthor()); }
public boolean isAuthor(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_AUTHOR){ return true; } } return false; }
UserAccount extends BaseAuditableEntity implements SocialUserDetails { public boolean isAuthor(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_AUTHOR){ return true; } } return false; } }
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); }
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 setUserId(String userId); UserRoleType[] getRoles(); void setRoles(UserRoleType[] roles); String getEmail(); void setEmail(String email); String getDisplayName(); void setDisplayName(String displayName); String getImageUrl(); void setImageUrl(String imageUrl); String getWebSite(); void setWebSite(String webSite); boolean isAccountLocked(); void setAccountLocked(boolean accountLocked); boolean isTrustedAccount(); void setTrustedAccount(boolean trustedAccount); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override String getPassword(); @Override String getUsername(); boolean isAuthor(); boolean isAdmin(); void updateProfile(String displayName, String email, String webSite); @Override String toString(); }
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 setUserId(String userId); UserRoleType[] getRoles(); void setRoles(UserRoleType[] roles); String getEmail(); void setEmail(String email); String getDisplayName(); void setDisplayName(String displayName); String getImageUrl(); void setImageUrl(String imageUrl); String getWebSite(); void setWebSite(String webSite); boolean isAccountLocked(); void setAccountLocked(boolean accountLocked); boolean isTrustedAccount(); void setTrustedAccount(boolean trustedAccount); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override String getPassword(); @Override String getUsername(); boolean isAuthor(); boolean isAdmin(); void updateProfile(String displayName, String email, String webSite); @Override String toString(); }
@Test public void testIsAdmin() { UserAccount normalUser = new UserAccount(); assertFalse(normalUser.isAdmin()); UserRoleType[] roles = new UserRoleType[]{UserRoleType.ROLE_USER, UserRoleType.ROLE_ADMIN}; UserAccount author = new UserAccount("1234", roles); assertTrue(author.isAdmin()); }
public boolean isAdmin(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_ADMIN){ return true; } } return false; }
UserAccount extends BaseAuditableEntity implements SocialUserDetails { public boolean isAdmin(){ for (UserRoleType role : getRoles()) { if (role == UserRoleType.ROLE_ADMIN){ return true; } } return false; } }
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); }
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 setUserId(String userId); UserRoleType[] getRoles(); void setRoles(UserRoleType[] roles); String getEmail(); void setEmail(String email); String getDisplayName(); void setDisplayName(String displayName); String getImageUrl(); void setImageUrl(String imageUrl); String getWebSite(); void setWebSite(String webSite); boolean isAccountLocked(); void setAccountLocked(boolean accountLocked); boolean isTrustedAccount(); void setTrustedAccount(boolean trustedAccount); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override String getPassword(); @Override String getUsername(); boolean isAuthor(); boolean isAdmin(); void updateProfile(String displayName, String email, String webSite); @Override String toString(); }
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 setUserId(String userId); UserRoleType[] getRoles(); void setRoles(UserRoleType[] roles); String getEmail(); void setEmail(String email); String getDisplayName(); void setDisplayName(String displayName); String getImageUrl(); void setImageUrl(String imageUrl); String getWebSite(); void setWebSite(String webSite); boolean isAccountLocked(); void setAccountLocked(boolean accountLocked); boolean isTrustedAccount(); void setTrustedAccount(boolean trustedAccount); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override String getPassword(); @Override String getUsername(); boolean isAuthor(); boolean isAdmin(); void updateProfile(String displayName, String email, String webSite); @Override String toString(); }
@Test public void testCall() throws Exception { class I implements ThrowingFunction<String, String> { @Override public String apply(String argument) throws Exception { X x = deps.getInstance(X.class); assertNotNull(x); assertEquals("test", x.toString()); return argument + "." + x.toString(); } } String s = SCOPE.run(new I(), "hello", x); assertNotNull(s); assertEquals("hello." + x.toString(), s); }
public <T> T call(Callable<T> toCall, Object... scopeContents) throws Exception { enter(scopeContents); try { return toCall.call(); } finally { exit(); } }
SingleEntryScope extends AbstractScope implements Scope { public <T> T call(Callable<T> toCall, Object... scopeContents) throws Exception { enter(scopeContents); try { return toCall.call(); } finally { exit(); } } }
SingleEntryScope extends AbstractScope implements Scope { public <T> T call(Callable<T> toCall, Object... scopeContents) throws Exception { enter(scopeContents); try { return toCall.call(); } finally { exit(); } } }
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... scopeContents); @Override boolean inScope(); }
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... scopeContents); @Override boolean inScope(); }