|
24 | 24 | import java.util.regex.Pattern; |
25 | 25 | import java.util.stream.Stream; |
26 | 26 |
|
27 | | -import org.hiero.block.tools.commands.days.download.DownloadConstants; |
| 27 | +import com.google.cloud.storage.Storage; |
| 28 | +import com.google.cloud.storage.StorageOptions; |
28 | 29 | import org.hiero.block.tools.commands.days.download.DownloadDayUtil; |
29 | 30 | import org.hiero.block.tools.commands.days.model.AddressBookRegistry; |
30 | 31 | import org.hiero.block.tools.commands.mirrornode.BlockInfo; |
|
36 | 37 | import org.hiero.block.tools.records.RecordFileInfo; |
37 | 38 | import org.hiero.block.tools.utils.Gzip; |
38 | 39 | import org.hiero.block.tools.utils.gcp.ConcurrentDownloadManager; |
39 | | -import org.hiero.block.tools.utils.gcp.ConcurrentDownloadManagerTransferManager; |
| 40 | +import org.hiero.block.tools.utils.gcp.ConcurrentDownloadManagerVirtualThreads; |
40 | 41 | import picocli.CommandLine; |
41 | 42 | import picocli.CommandLine.Command; |
42 | 43 | import picocli.CommandLine.Option; |
43 | 44 |
|
| 45 | +import static org.hiero.block.tools.commands.days.download.DownloadConstants.GCP_PROJECT_ID; |
| 46 | + |
44 | 47 | /** |
45 | 48 | * CLI implementation for the {@code days download-live} command. |
46 | 49 | * |
@@ -568,7 +571,7 @@ static final class LiveDownloader { |
568 | 571 | private final int maxConcurrency; |
569 | 572 | private final Path addressBookPath; |
570 | 573 | private final AddressBookRegistry addressBookRegistry; |
571 | | - private final ConcurrentDownloadManager downloadManager; |
| 574 | + private final ConcurrentDownloadManagerVirtualThreads downloadManager; |
572 | 575 | // Running previous record-file hash used to validate the block hash chain across files. |
573 | 576 | private byte[] previousRecordFileHash; |
574 | 577 | // Single-threaded executor used for background compression of per-day tar files. |
@@ -602,7 +605,12 @@ static final class LiveDownloader { |
602 | 605 | // NOTE: if the actual ConcurrentDownloadManagerTransferManager constructor has a different signature, |
603 | 606 | // adjust this |
604 | 607 | // call to match its configuration factory used by the historic download2 tooling. |
605 | | - this.downloadManager = new ConcurrentDownloadManagerTransferManager(); |
| 608 | + Storage storage = StorageOptions.grpc() |
| 609 | + .setAttemptDirectPath(false) |
| 610 | + .setProjectId(GCP_PROJECT_ID) |
| 611 | + .build() |
| 612 | + .getService(); |
| 613 | + this.downloadManager = ConcurrentDownloadManagerVirtualThreads.newBuilder(storage).build(); |
606 | 614 | this.compressionExecutor = Executors.newSingleThreadExecutor(r -> { |
607 | 615 | Thread t = new Thread(r, "download-live-compress"); |
608 | 616 | t.setDaemon(true); |
|
0 commit comments