private synchronized ClientBlobStore getBlobStore() { if (blobStore == null) { blobStore = Utils.getClientBlobStore(conf); } return blobStore; }
/** * Returns PMML model from Blobstore * @param blobKey key of PMML model in Blobstore * @param config Configuration to use to get Blobstore client */ public static InputStream getPmmlModelBlob(String blobKey, Map<String, Object> config) { Objects.requireNonNull(blobKey); Objects.requireNonNull(config); try { return Utils.getClientBlobStore(config).getBlob(blobKey); } catch (Exception e) { throw new RuntimeException("Failed to download PMML Model from Blobstore using blob key [" + blobKey + "]", e); } }
public static void withConfiguredClient(WithBlobstore withBlobstore) throws Exception { Map<String, Object> conf = ConfigUtils.readStormConfig(); try (ClientBlobStore blobStore = Utils.getClientBlobStore(conf)) { withBlobstore.run(blobStore); } }
public static void prepare() { Config conf = new Config(); conf.putAll(Utils.readStormConfig()); store = Utils.getClientBlobStore(conf); }
private synchronized ClientBlobStore getBlobStore() { if (blobStore == null) { blobStore = Utils.getClientBlobStore(conf); } return blobStore; }
/** * Returns PMML model from Blobstore * @param blobKey key of PMML model in Blobstore * @param config Configuration to use to get Blobstore client */ public static InputStream getPmmlModelBlob(String blobKey, Map config) { Objects.requireNonNull(blobKey); Objects.requireNonNull(config); try { return Utils.getClientBlobStore(config).getBlob(blobKey); } catch (Exception e) { throw new RuntimeException("Failed to download PMML Model from Blobstore using blob key [" + blobKey + "]", e); } }