/** * Same as {@link #createObjectStore(ApplicationConfigurer, String, Type, DatasetProperties)} but with empty * properties. */ public static void createObjectStore(ApplicationConfigurer configurer, String datasetName, Type type) throws UnsupportedTypeException { createObjectStore(configurer, datasetName, type, DatasetProperties.EMPTY); }
/** * Adds {@link IndexedObjectStore} dataset to be created at application deploy if not exists. * @param configurer application configurer * @param datasetName dataset name * @param type type of objects to be stored in {@link IndexedObjectStore} * @param props any additional dataset properties * @throws UnsupportedTypeException */ public static void createIndexedObjectStore(ApplicationConfigurer configurer, String datasetName, Type type, DatasetProperties props) throws UnsupportedTypeException { configurer.createDataset(datasetName, IndexedObjectStore.class, objectStoreProperties(type, props)); }
/** * Same as {@link #createIndexedObjectStore(ApplicationConfigurer, String, Type, DatasetProperties)} but with empty * properties. */ public static void createIndexedObjectStore(ApplicationConfigurer configurer, String datasetName, Type type) throws UnsupportedTypeException { createIndexedObjectStore(configurer, datasetName, type, DatasetProperties.EMPTY); }
@Override public void configure() { try { setName(NAME); setDescription("Sample application"); ObjectStores.createObjectStore(getConfigurer(), "input", String.class); ObjectStores.createObjectStore(getConfigurer(), "output", String.class); addMapReduce(new WordCountMapReduce()); addWorkflow(new SampleWorkflow()); } catch (UnsupportedTypeException e) { throw Throwables.propagate(e); } }
/** * Adds an {@link ObjectStore} dataset to be created at application deploy if it does not exist. * * @param configurer application configurer * @param datasetName dataset name * @param type type of objects to be stored in {@link ObjectStore} * @param props any additional dataset properties * @throws UnsupportedTypeException */ public static void createObjectStore(ApplicationConfigurer configurer, String datasetName, Type type, DatasetProperties props) throws UnsupportedTypeException { configurer.createDataset(datasetName, ObjectStore.class, objectStoreProperties(type, props)); }
@Override public void configure() { try { setName("AppWithMapReduceObjectStore"); setDescription("Application with MapReduce job using objectstore as dataset"); createDataset("count", KeyValueTable.class); ObjectStores.createObjectStore(getConfigurer(), "keys", String.class); addMapReduce(new ComputeCounts()); } catch (Throwable t) { throw Throwables.propagate(t); } }
private void createObjectStoreInstance(DatasetId datasetInstanceId, Type type) throws Exception { dsFrameworkUtil.createInstance("objectStore", datasetInstanceId, ObjectStores.objectStoreProperties(type, DatasetProperties.EMPTY)); }
@Override public void configure() { try { setName("AppWithSchedule"); setDescription("Sample application"); ObjectStores.createObjectStore(getConfigurer(), INPUT_NAME, String.class); ObjectStores.createObjectStore(getConfigurer(), OUTPUT_NAME, String.class); addWorkflow(new SampleWorkflow()); schedule(buildSchedule(EVERY_HOUR_SCHEDULE, ProgramType.WORKFLOW, WORKFLOW_NAME) .triggerByTime("0 */1 * * *")); schedule(buildSchedule(EVERY_THREE_SECOND_SCHEDULE, ProgramType.WORKFLOW, WORKFLOW_NAME) .triggerByTime("0/3 * * * * ?")); } catch (UnsupportedTypeException e) { throw Throwables.propagate(e); } }
protected void createIndexedObjectStoreInstance(DatasetId datasetInstanceId, Type type) throws Exception { dsFrameworkUtil.createInstance("indexedObjectStore", datasetInstanceId, ObjectStores.objectStoreProperties(type, DatasetProperties.EMPTY)); }
@Override public void configure() { try { createDataset("count", KeyValueTable.class); createDataset("totals", Table.class); ObjectStores.createObjectStore(getConfigurer(), "keys", String.class); addSpark(new CharCountProgram()); addSpark(new ScalaCharCountProgram()); addSpark(new ScalaCrossNSProgram()); } catch (Throwable t) { throw Throwables.propagate(t); } } }
setName(NAME); setDescription("Sample application"); ObjectStores.createObjectStore(getConfigurer(), "input", String.class); ObjectStores.createObjectStore(getConfigurer(), "output", String.class); AppConfig config = getConfig();