/** * Get the sync point list. * * @return a list of URIs (sync points) */ public List<SyncPointInfo> getSyncPathList() { List<SyncPointInfo> returnList = new ArrayList<>(); for (AlluxioURI uri: mSyncPathList) { SyncPointInfo.SyncStatus status; Future<?> syncStatus = mSyncPathStatus.get(uri); if (syncStatus == null) { status = SyncPointInfo.SyncStatus.NOT_INITIALLY_SYNCED; } else if (syncStatus.isDone()) { status = SyncPointInfo.SyncStatus.INITIALLY_SYNCED; } else { status = SyncPointInfo.SyncStatus.SYNCING; } returnList.add(new SyncPointInfo(uri, status)); } return returnList; }
/** * Generate sync point information from the proto representation. * @param syncPointInfo the proto representation * @return sync point info object */ public static SyncPointInfo fromProto(alluxio.grpc.SyncPointInfo syncPointInfo) { SyncStatus syncStatus; switch (syncPointInfo.getSyncStatus()) { case Not_Initially_Synced: syncStatus = SyncStatus.NOT_INITIALLY_SYNCED; break; case Syncing: syncStatus = SyncStatus.SYNCING; break; case Initially_Synced: syncStatus = SyncStatus.INITIALLY_SYNCED; break; default: syncStatus = SyncStatus.NOT_INITIALLY_SYNCED; } return new SyncPointInfo(new AlluxioURI(syncPointInfo.getSyncPointUri()), syncStatus); } }