Search in sources :

Example 1 with BlobSynchronizer

use of com.alibaba.jstorm.blobstore.BlobSynchronizer in project jstorm by alibaba.

the class FollowerRunnable method blobSync.

private synchronized void blobSync() {
    if (!data.isLeader()) {
        try {
            BlobStore blobStore = data.getBlobStore();
            StormClusterState clusterState = data.getStormClusterState();
            Set<String> localKeys = Sets.newHashSet(blobStore.listKeys());
            Set<String> zkKeys = Sets.newHashSet(clusterState.blobstore(blobSyncCallback));
            BlobSynchronizer blobSynchronizer = new BlobSynchronizer(blobStore, data.getConf());
            blobSynchronizer.setNimbusInfo(data.getNimbusHostPortInfo());
            blobSynchronizer.setBlobStoreKeySet(localKeys);
            blobSynchronizer.setZookeeperKeySet(zkKeys);
            blobSynchronizer.syncBlobs();
        } catch (Exception e) {
            LOG.error("blob sync error", e);
        }
    }
}
Also used : BlobSynchronizer(com.alibaba.jstorm.blobstore.BlobSynchronizer) StormClusterState(com.alibaba.jstorm.cluster.StormClusterState) BlobStore(com.alibaba.jstorm.blobstore.BlobStore) LocalFsBlobStore(com.alibaba.jstorm.blobstore.LocalFsBlobStore)

Aggregations

BlobStore (com.alibaba.jstorm.blobstore.BlobStore)1 BlobSynchronizer (com.alibaba.jstorm.blobstore.BlobSynchronizer)1 LocalFsBlobStore (com.alibaba.jstorm.blobstore.LocalFsBlobStore)1 StormClusterState (com.alibaba.jstorm.cluster.StormClusterState)1