public SettableBlobMeta deepCopy() { return new SettableBlobMeta(this); }
/** * Performs a deep copy on <i>other</i>. */ public ReadableBlobMeta(ReadableBlobMeta other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_settable()) { this.settable = new SettableBlobMeta(other.settable); } this.version = other.version; }
/** * create local topology files in blobstore and sync metadata to zk */ private static void setupStormCode(Map conf, String topologyId, String topologyRoot, Set<String> activeKeys) throws Exception { Map<String, String> blobKeysToLocation = getBlobKeysToLocation(topologyRoot, topologyId); for (Map.Entry<String, String> entry : blobKeysToLocation.entrySet()) { String key = entry.getKey(); String location = entry.getValue(); if (!activeKeys.contains(key)) { blobStore.createBlob(key, new FileInputStream(location), new SettableBlobMeta()); if (isLocalBlobStore) { int versionInfo = BlobStoreUtils.getVersionForKey(key, nimbusInfo, conf); clusterState.setup_blobstore(key, nimbusInfo, versionInfo); } } } System.out.println("Successfully create blobstore for topology " + topologyId); }
case 1: // SETTABLE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); struct.version = iprot.readI64(); struct.set_version_isSet(true); } }
private void createOrUpdateBlob(String key, byte[] blobData, boolean update, String topologyId) throws Exception { StormClusterState clusterState = data.getStormClusterState(); BlobStore blobStore = data.getBlobStore(); NimbusInfo nimbusInfo = data.getNimbusHostPortInfo(); if (update) { BlobStoreUtils.updateBlob(blobStore, key, blobData); LOG.info("Successfully updated blobstore for topology:{}, key:{}", topologyId, key); } else { blobStore.createBlob(key, blobData, new SettableBlobMeta()); LOG.info("Successfully created blobstore for topology:{}, key:{}", topologyId, key); } if (blobStore instanceof LocalFsBlobStore) { clusterState.setup_blobstore(key, nimbusInfo, BlobStoreUtils.getVersionForKey(key, nimbusInfo, conf)); } }
private void createOrUpdateBlob(String key, InputStream stream, boolean update, String topologyId) throws Exception { StormClusterState clusterState = data.getStormClusterState(); BlobStore blobStore = data.getBlobStore(); NimbusInfo nimbusInfo = data.getNimbusHostPortInfo(); if (update) { BlobStoreUtils.updateBlob(blobStore, key, stream); LOG.info("Successfully updated blobstore for topology:{}, key:{}", topologyId, key); } else { blobStore.createBlob(key, stream, new SettableBlobMeta()); LOG.info("Successfully created blobstore for topology:{}, key:{}", topologyId, key); } if (blobStore instanceof LocalFsBlobStore) { clusterState.setup_blobstore(key, nimbusInfo, BlobStoreUtils.getVersionForKey(key, nimbusInfo, conf)); } }
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)); } }
public SettableBlobMeta deepCopy() { return new SettableBlobMeta(this); }
/** * Performs a deep copy on <i>other</i>. */ public ReadableBlobMeta(ReadableBlobMeta other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_settable()) { this.settable = new SettableBlobMeta(other.settable); } this.version = other.version; }
/** * create local topology files in blobstore and sync metadata to zk */ private static void setupStormCode(Map conf, String topologyId, String topologyRoot, Set<String> activeKeys) throws Exception { Map<String, String> blobKeysToLocation = getBlobKeysToLocation(topologyRoot, topologyId); for (Map.Entry<String, String> entry : blobKeysToLocation.entrySet()) { String key = entry.getKey(); String location = entry.getValue(); if (!activeKeys.contains(key)) { blobStore.createBlob(key, new FileInputStream(location), new SettableBlobMeta()); if (isLocalBlobStore) { int versionInfo = BlobStoreUtils.getVersionForKey(key, nimbusInfo, conf); clusterState.setup_blobstore(key, nimbusInfo, versionInfo); } } } System.out.println("Successfully create blobstore for topology " + topologyId); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); struct.version = iprot.readI64(); struct.set_version_isSet(true); } }
BlobStoreUtils.updateBlob(blobStore, libJarKey, new FileInputStream(jar)); } else { blobStore.createBlob(libJarKey, new FileInputStream(jar), new SettableBlobMeta()); BlobStoreUtils.updateBlob(blobStore, jarKey, new FileInputStream(jarPath)); } else { blobStore.createBlob(jarKey, new FileInputStream(jarPath), new SettableBlobMeta());
/** * create local topology files in blobstore and sync metadata to zk */ private void setupStormCode(Map<Object, Object> conf, String topologyId, String tmpJarLocation, Map<Object, Object> stormConf, StormTopology topology) throws Exception { StormClusterState clusterState = data.getStormClusterState(); BlobStore blobStore = data.getBlobStore(); NimbusInfo nimbusInfo = data.getNimbusHostPortInfo(); String codeKey = StormConfig.master_stormcode_key(topologyId); String confKey = StormConfig.master_stormconf_key(topologyId); // in local mode there is no jar if (tmpJarLocation != null) { setupJar(tmpJarLocation, topologyId, blobStore, clusterState, nimbusInfo, false); } blobStore.createBlob(confKey, Utils.serialize(stormConf), new SettableBlobMeta()); blobStore.createBlob(codeKey, Utils.serialize(topology), new SettableBlobMeta()); if (blobStore instanceof LocalFsBlobStore) { clusterState.setup_blobstore(confKey, nimbusInfo, BlobStoreUtils.getVersionForKey(confKey, nimbusInfo, conf)); clusterState.setup_blobstore(codeKey, nimbusInfo, BlobStoreUtils.getVersionForKey(codeKey, nimbusInfo, conf)); } LOG.info("Successfully create blobstore for topology {}", topologyId); }
case 1: // SETTABLE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true);