Skip to content

Commit

Permalink
Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
FilahAnas committed Mar 29, 2024
1 parent 73b615e commit 990c939
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mongodb-source-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Tag Docker image
run: docker tag airbyte/source-mongodb-v2:dev sibengineering/airbyte-source-mongodb:1.3.0.10
run: docker tag airbyte/source-mongodb-v2:dev sibengineering/airbyte-source-mongodb:1.3.0.11

- name: Push Docker image to Docker Hub
run: docker push sibengineering/airbyte-source-mongodb:1.3.0.10
run: docker push sibengineering/airbyte-source-mongodb:1.3.0.11
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ public static int getDebeziumEventQueueSize(final MongoDbSourceConfig config) {
public static Optional<CollectionStatistics> getCollectionStatistics(final MongoClient mongoClient, final ConfiguredAirbyteStream stream) {
try {
final Map<String, Object> collStats = Map.of(MongoConstants.STORAGE_STATS_KEY, Map.of(), MongoConstants.COUNT_KEY, Map.of());
final MongoDatabase mongoDatabase = mongoClient.getDatabase(stream.getStream().getNamespace());
final MongoCollection<Document> collection = mongoDatabase.getCollection(stream.getStream().getName());
// final MongoDatabase mongoDatabase = mongoClient.getDatabase(stream.getStream().getNamespace());
final MongoCollection<Document> collection = mongoClient.getDatabase(stream.getStream().getNamespace()).getCollection(stream.getStream().getName());
final AggregateIterable<Document> output = collection.aggregate(List.of(new Document("$collStats", collStats)));

try (final MongoCursor<Document> cursor = output.allowDiskUse(true).cursor()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ public List<AutoCloseableIterator<AirbyteMessage>> createCdcIterators(

private void logOplogInfo(final MongoClient mongoClient) {
try {
final MongoDatabase localDatabase = mongoClient.getDatabase("local");
// final MongoDatabase localDatabase = mongoClient.getDatabase("local");
final Document command = new Document("collStats", "oplog.rs");
final Document result = localDatabase.runCommand(command);
final Document result = mongoClient.getDatabase("local").runCommand(command);
if (result != null) {
LOGGER.info("Max oplog size is {} bytes", result.getLong("maxSize"));
LOGGER.info("Free space in oplog is {} bytes", result.getLong("freeStorageSize"));
Expand Down

0 comments on commit 990c939

Please sign in to comment.