Skip to content

Commit

Permalink
remove validation from source delete (#8724)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens authored Dec 16, 2021
1 parent 2ad4ca1 commit 3a69029
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected void acceptTracked(final AirbyteMessage message) throws Exception {
// TODO use a more efficient way to compute bytes that doesn't require double serialization (records
// are serialized again when writing to
// the destination
long messageSizeInBytes = ByteUtils.getSizeInBytes(Jsons.serialize(recordMessage.getData()));
final long messageSizeInBytes = ByteUtils.getSizeInBytes(Jsons.serialize(recordMessage.getData()));
if (bufferSizeInBytes + messageSizeInBytes >= maxQueueSizeInBytes) {
flushQueueToDestination();
bufferSizeInBytes = 0;
Expand Down Expand Up @@ -202,7 +202,7 @@ protected void close(final boolean hasFailed) throws Exception {
}

try {
// if no state was was emitted (i.e. full refresh), if there were still no failures, then we can
// if no state was emitted (i.e. full refresh), if there were still no failures, then we can
// still succeed.
if (lastFlushedState == null) {
onClose.accept(hasFailed);
Expand All @@ -211,7 +211,7 @@ protected void close(final boolean hasFailed) throws Exception {
onClose.accept(false);
}

// if one close succeeds without exception then we can emit the state record because it means its
// if onClose succeeds without exception then we can emit the state record because it means its
// records were not only flushed, but committed.
if (lastFlushedState != null) {
outputRecordCollector.accept(lastFlushedState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void deleteDestination(final DestinationIdRequestBody destinationIdReques
public void deleteDestination(final DestinationRead destination)
throws JsonValidationException, IOException, ConfigNotFoundException {
// disable all connections associated with this destination
// Delete connections first in case it it fails in the middle, destination will still be visible
// Delete connections first in case it fails in the middle, destination will still be visible
final WorkspaceIdRequestBody workspaceIdRequestBody = new WorkspaceIdRequestBody().workspaceId(destination.getWorkspaceId());
for (final ConnectionRead connectionRead : connectionsHandler.listConnectionsForWorkspace(workspaceIdRequestBody).getConnections()) {
if (!connectionRead.getDestinationId().equals(destination.getDestinationId())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void deleteSource(final SourceIdRequestBody sourceIdRequestBody)
public void deleteSource(final SourceRead source)
throws JsonValidationException, IOException, ConfigNotFoundException {
// "delete" all connections associated with source as well.
// Delete connections first in case it it fails in the middle, source will still be visible
// Delete connections first in case it fails in the middle, source will still be visible
final WorkspaceIdRequestBody workspaceIdRequestBody = new WorkspaceIdRequestBody()
.workspaceId(source.getWorkspaceId());
for (final ConnectionRead connectionRead : connectionsHandler
Expand All @@ -170,10 +170,7 @@ public void deleteSource(final SourceRead source)
}

final ConnectorSpecification spec = getSpecFromSourceId(source.getSourceId());
validateSource(spec, source.getConnectionConfiguration());

final var fullConfig = configRepository.getSourceConnectionWithSecrets(source.getSourceId()).getConfiguration();
validateSource(spec, fullConfig);

// persist
persistSourceConnection(
Expand Down

0 comments on commit 3a69029

Please sign in to comment.