Skip to content

Commit

Permalink
fix format & computer option
Browse files Browse the repository at this point in the history
  • Loading branch information
Radeity committed Oct 11, 2023
1 parent d7c31ba commit 116eacb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,55 +201,55 @@ public static synchronized ComputerOptions instance() {
public static final ConfigOption<Boolean> SNAPSHOT_WRITE =
new ConfigOption<>(
"snapshot.write",
"Whether write snapshot of input vertex and edge partitions",
"Whether to write snapshot of input vertex/edge partitions.",
allowValues(true, false),
false
);

public static final ConfigOption<Boolean> SNAPSHOT_LOAD =
new ConfigOption<>(
"snapshot.load",
"Whether use snapshot of input vertex and edge partitions",
"Whether to load from snapshot of vertex/edge partitions.",
allowValues(true, false),
false
);

public static final ConfigOption<String> SNAPSHOT_VIEW_KEY =
public static final ConfigOption<String> SNAPSHOT_NAME =
new ConfigOption<>(
"snapshot.view_key",
"View key of target snapshot",
"snapshot.name",
"The user-defined snapshot name.",
null,
""
);

public static final ConfigOption<String> SNAPSHOT_MINIO_ENDPOINT =
new ConfigOption<>(
"snapshot.minio_endpoint",
"MinIO endpoint",
"The endpoint of MinIO, MinIO can be used to store snapshots.",
null,
""
);

public static final ConfigOption<String> SNAPSHOT_MINIO_ACCESS_KEY =
new ConfigOption<>(
"snapshot.minio_access_key",
"MinIO access key",
"The access key of MinIO.",
null,
""
);

public static final ConfigOption<String> SNAPSHOT_MINIO_SECRET_KEY =
new ConfigOption<>(
"snapshot.minio_secret_key",
"MinIO secret key",
"The secret key of MinIO.",
null,
""
);

public static final ConfigOption<String> SNAPSHOT_MINIO_BUCKET_NAME =
new ConfigOption<>(
"snapshot.minio_bucket_name",
"MinIO bucket name",
"The bucket name of MinIO.",
null,
""
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SnapshotManager implements Manager {
private final int partitionCount;
private final boolean loadSnapshot;
private final boolean writeSnapshot;
private final String viewKey;
private final String snapshotName;

private MinioClient minioClient;
private String bucketName;
Expand All @@ -78,7 +78,7 @@ public SnapshotManager(ComputerContext context, MessageSendManager sendManager,
this.workerInfo = workerInfo;
this.partitioner = context.config().createObject(ComputerOptions.WORKER_PARTITIONER);
this.partitionCount = context.config().get(ComputerOptions.JOB_PARTITIONS_COUNT);
this.viewKey = context.config().get(ComputerOptions.SNAPSHOT_VIEW_KEY);
this.snapshotName = context.config().get(ComputerOptions.SNAPSHOT_NAME);
}

@Override
Expand Down Expand Up @@ -243,8 +243,8 @@ private void clearObjectsIfExist(String dirName) throws Exception {
}

private String generateObjectDirName(MessageType messageType, int partitionId) {
// dir name: {VIEW_KEY}/{PARTITIONER}/{PARTITION_COUNT}/VERTEX/{PARTITION_ID}/
Path path = Paths.get(this.viewKey,
// dir name: {SNAPSHOT_NAME}/{PARTITIONER}/{PARTITION_COUNT}/VERTEX/{PARTITION_ID}/
Path path = Paths.get(this.snapshotName,
this.partitioner.getClass().getSimpleName(),
String.valueOf(this.partitionCount),
messageType.name(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public void setup() {
sortManager);
this.managers.add(receiveManager);
SnapshotManager snapshotManager = new SnapshotManager(context(),
null,
null,
receiveManager,
null);
null);
this.managers.add(snapshotManager);
this.managers.initAll(this.config);
this.connectionId = new ConnectionId(new InetSocketAddress("localhost",
Expand Down Expand Up @@ -231,7 +231,7 @@ private static void addMessages(Consumer<NetworkBuffer> consumer)
message.add(id);
ReceiverUtil.consumeBuffer(ReceiverUtil.writeMessage(id,
message),
consumer);
consumer);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ private void testEdgeFreq(EdgeFrequency freq)
sortManager);
this.managers.add(receiveManager);
SnapshotManager snapshotManager = new SnapshotManager(context(),
null,
null,
receiveManager,
null);
null);
this.managers.add(snapshotManager);
this.managers.initAll(this.config);
ConnectionId connectionId = new ConnectionId(new InetSocketAddress(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public void setup() {
sortManager);
this.managers.add(receiveManager);
SnapshotManager snapshotManager = new SnapshotManager(context(),
null,
null,
receiveManager,
null);
null);
this.managers.add(snapshotManager);
this.managers.initAll(this.config);
this.connectionId = new ConnectionId(new InetSocketAddress("localhost",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public void test() {
fileManager,
sortManager);
SnapshotManager snapshotManager = new SnapshotManager(context(),
null,
null,
recvManager,
null);
null);
recvManager.init(config);
ConnectionManager connManager = new TransportConnectionManager();
DataServerManager serverManager = new DataServerManager(connManager,
Expand Down

0 comments on commit 116eacb

Please sign in to comment.