Search in sources :

Example 1 with SyncPointInfo

use of alluxio.wire.SyncPointInfo in project alluxio by Alluxio.

the class GetSyncPathListCommand method run.

@Override
public int run(CommandLine cl) throws AlluxioException, IOException {
    List<SyncPointInfo> files = mFileSystem.getSyncPathList();
    System.out.println("The following paths are under active sync");
    for (SyncPointInfo syncPointInfo : files) {
        System.out.print(syncPointInfo.getSyncPointUri() + "\t");
        switch(syncPointInfo.getSyncStatus()) {
            case NOT_INITIALLY_SYNCED:
                System.out.println("Initial Sync Skipped");
                break;
            case INITIALLY_SYNCED:
                System.out.println("Initial Sync Done");
                break;
            case SYNCING:
                System.out.println("Initial Sync In Progress");
                break;
            default:
                System.out.println("Invalid Syncing Status");
        }
    }
    return 0;
}
Also used : SyncPointInfo(alluxio.wire.SyncPointInfo)

Example 2 with SyncPointInfo

use of alluxio.wire.SyncPointInfo in project alluxio by Alluxio.

the class ActiveSyncManager method getSyncPathList.

/**
 * 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;
}
Also used : SyncPointInfo(alluxio.wire.SyncPointInfo) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) AlluxioURI(alluxio.AlluxioURI)

Aggregations

SyncPointInfo (alluxio.wire.SyncPointInfo)2 AlluxioURI (alluxio.AlluxioURI)1 ArrayList (java.util.ArrayList)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1