Search in sources :

Example 11 with SettableBlobMeta

use of backtype.storm.generated.SettableBlobMeta in project jstorm by alibaba.

the class ServiceHandler method backupBlob.

private void backupBlob(String oldKey, String newKey, String topologyId) throws Exception {
    LOG.info("Backing topology {} blob key {} to {}", topologyId, oldKey, newKey);
    StormClusterState clusterState = data.getStormClusterState();
    BlobStore blobStore = data.getBlobStore();
    NimbusInfo nimbusInfo = data.getNimbusHostPortInfo();
    InputStreamWithMeta oldStream = blobStore.getBlob(oldKey);
    BlobStoreUtils.cleanup_key(newKey, blobStore, clusterState);
    blobStore.createBlob(newKey, oldStream, new SettableBlobMeta());
    if (blobStore instanceof LocalFsBlobStore) {
        clusterState.setup_blobstore(newKey, nimbusInfo, BlobStoreUtils.getVersionForKey(newKey, nimbusInfo, conf));
    }
}
Also used : StormClusterState(com.alibaba.jstorm.cluster.StormClusterState) LocalFsBlobStore(com.alibaba.jstorm.blobstore.LocalFsBlobStore) InputStreamWithMeta(com.alibaba.jstorm.blobstore.InputStreamWithMeta) SettableBlobMeta(backtype.storm.generated.SettableBlobMeta) BlobStore(com.alibaba.jstorm.blobstore.BlobStore) LocalFsBlobStore(com.alibaba.jstorm.blobstore.LocalFsBlobStore) NimbusInfo(backtype.storm.nimbus.NimbusInfo)

Aggregations

SettableBlobMeta (backtype.storm.generated.SettableBlobMeta)11 LocalFsBlobStore (com.alibaba.jstorm.blobstore.LocalFsBlobStore)5 NimbusInfo (backtype.storm.nimbus.NimbusInfo)4 BlobStore (com.alibaba.jstorm.blobstore.BlobStore)4 StormClusterState (com.alibaba.jstorm.cluster.StormClusterState)4 FileInputStream (java.io.FileInputStream)2 IOException (java.io.IOException)2 ReadableBlobMeta (backtype.storm.generated.ReadableBlobMeta)1 BufferFileInputStream (backtype.storm.utils.BufferFileInputStream)1 InputStreamWithMeta (com.alibaba.jstorm.blobstore.InputStreamWithMeta)1 File (java.io.File)1 Test (org.junit.Test)1