public ClassManifest<V> valueType() { return (ClassManifest<V>) ClassManifest$.MODULE$.fromClass(Object.class); } }
/** * @param <C> the classtag's type. * @return an any ClassTag typed according to the Java compiler as C. */ public static <C> scala.reflect.ClassTag<C> classTag() { return (scala.reflect.ClassTag<C>) scala.reflect.ClassTag$.MODULE$.Any(); }
/** * Create a provider for an actor implemented by the given class, with the given name. * * This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned * provider will provide the ActorRef for the actor, allowing it to be injected into other components. * * Typically, you will want to use this in combination with a named qualifier, so that multiple ActorRefs can be * bound, and the scope should be set to singleton or eager singleton. * * @param <T> the type of the actor * @param actorClass The class that implements the actor. * @param name The name of the actor. * @param props A function to provide props for the actor. The props passed in will just describe how to create the * actor, this function can be used to provide additional configuration such as router and dispatcher * configuration. * @return A provider for the actor. */ public static <T extends Actor> Provider<ActorRef> providerOf(Class<T> actorClass, String name, Function<Props, Props> props) { return new ActorRefProvider<T>(name, new AbstractFunction1<Props, Props>() { public Props apply(Props p) { return props.apply(p); } }, ClassTag$.MODULE$.apply(actorClass)); }
/** * Returns an any ClassTag typed according to the Java compiler as C. */ public static <C> scala.reflect.ClassTag<C> classTag() { return (scala.reflect.ClassTag<C>) scala.reflect.ClassTag$.MODULE$.Any(); }
public ClassManifest<R> returnType() { return (ClassManifest<R>) ClassManifest$.MODULE$.fromClass(Object.class); } }
/** * Create a provider for an actor implemented by the given class, with the given name. * * This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned * provider will provide the ActorRef for the actor, allowing it to be injected into other components. * * Typically, you will want to use this in combination with a named qualifier, so that multiple ActorRefs can be * bound, and the scope should be set to singleton or eager singleton. * * @param <T> the type of the actor * @param actorClass The class that implements the actor. * @param name The name of the actor. * @param props A function to provide props for the actor. The props passed in will just describe how to create the * actor, this function can be used to provide additional configuration such as router and dispatcher * configuration. * @return A provider for the actor. */ public static <T extends Actor> Provider<ActorRef> providerOf(Class<T> actorClass, String name, Function<Props, Props> props) { return new ActorRefProvider<T>(name, new AbstractFunction1<Props, Props>() { public Props apply(Props p) { return props.apply(p); } }, ClassTag$.MODULE$.apply(actorClass)); }
/** * @param <C> the classtag's type. * @return an any ClassTag typed according to the Java compiler as C. */ public static <C> scala.reflect.ClassTag<C> classTag() { return (scala.reflect.ClassTag<C>) scala.reflect.ClassTag$.MODULE$.Any(); }
public ClassManifest<R> returnType() { return (ClassManifest<R>) ClassManifest$.MODULE$.fromClass(Object.class); } }
/** * Create a provider for an actor implemented by the given class, with the given name. * * This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned * provider will provide the ActorRef for the actor, allowing it to be injected into other components. * * Typically, you will want to use this in combination with a named qualifier, so that multiple ActorRefs can be * bound, and the scope should be set to singleton or eager singleton. * * @param <T> the type of the actor * @param actorClass The class that implements the actor. * @param name The name of the actor. * @param props A function to provide props for the actor. The props passed in will just describe how to create the * actor, this function can be used to provide additional configuration such as router and dispatcher * configuration. * @return A provider for the actor. */ public static <T extends Actor> Provider<ActorRef> providerOf(Class<T> actorClass, String name, Function<Props, Props> props) { return new ActorRefProvider<T>(name, new AbstractFunction1<Props, Props>() { public Props apply(Props p) { return props.apply(p); } }, ClassTag$.MODULE$.apply(actorClass)); }
/** * @param <C> the classtag's type. * @return an any ClassTag typed according to the Java compiler as C. */ public static <C> scala.reflect.ClassTag<C> classTag() { return (scala.reflect.ClassTag<C>) scala.reflect.ClassTag$.MODULE$.Any(); }
public ClassManifest<V> valueType() { return (ClassManifest<V>) ClassManifest$.MODULE$.fromClass(Object.class); } }
/** * Create a provider for an actor implemented by the given class, with the given name. * * This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned * provider will provide the ActorRef for the actor, allowing it to be injected into other components. * * Typically, you will want to use this in combination with a named qualifier, so that multiple ActorRefs can be * bound, and the scope should be set to singleton or eager singleton. * * @param actorClass The class that implements the actor. * @param name The name of the actor. * @param props A function to provide props for the actor. The props passed in will just describe how to create the * actor, this function can be used to provide additional configuration such as router and dispatcher * configuration. * @return A provider for the actor. */ public static <T extends Actor> Provider<ActorRef> providerOf(Class<T> actorClass, String name, Function<Props, Props> props) { return new ActorRefProvider<T>(name, new AbstractFunction1<Props, Props>() { public Props apply(Props p) { return props.apply(p); } }, ClassTag$.MODULE$.apply(actorClass)); }
public ClassManifest<R> returnType() { return (ClassManifest<R>) ClassManifest$.MODULE$.fromClass(Object.class); } }
@Override public boolean persist(List listEntity, EntityMetadata m, SparkClient sparkClient) { Seq s = scala.collection.JavaConversions.asScalaBuffer(listEntity).toList(); ClassTag tag = scala.reflect.ClassTag$.MODULE$.apply(m.getEntityClazz()); JavaRDD personRDD = sparkClient.sparkContext.parallelize(s, 1, tag).toJavaRDD(); DataFrame df = sparkClient.sqlContext.createDataFrame(personRDD, m.getEntityClazz()); String outputFilePath = getOutputFilePath(sparkClient.properties); String ext = (String) sparkClient.properties.get("format"); FileType fileType = FileFormatConstants.extension.get(ext); switch (fileType) { case CSV: return writeDataInCsvFile(df, outputFilePath); case JSON: return writeDataInJsonFile(df, outputFilePath); default: throw new UnsupportedOperationException("Files of type " + ext + " are not yet supported."); } }
public ClassManifest<R> returnType() { return (ClassManifest<R>) ClassManifest$.MODULE$.fromClass(Object.class); } }
@Override public boolean persist(List listEntity, EntityMetadata m, SparkClient sparkClient) { try { Seq s = scala.collection.JavaConversions.asScalaBuffer(listEntity).toList(); ClassTag tag = scala.reflect.ClassTag$.MODULE$.apply(m.getEntityClazz()); JavaRDD personRDD = sparkClient.sparkContext.parallelize(s, 1, tag).toJavaRDD(); DataFrame df = sparkClient.sqlContext.createDataFrame(personRDD, m.getEntityClazz()); sparkClient.sqlContext.sql("use " + m.getSchema()); if (logger.isDebugEnabled()) { logger.info("Below are the registered table with hive context: "); sparkClient.sqlContext.sql("show tables").show(); } df.write().insertInto(m.getTableName()); return true; } catch (Exception e) { throw new KunderaException("Cannot persist object(s)", e); } }
public ClassManifest<K> keyType() { return (ClassManifest<K>) ClassManifest$.MODULE$.fromClass(Object.class); }
@Override public boolean persist(List listEntity, EntityMetadata m, SparkClient sparkClient) { try { Seq s = scala.collection.JavaConversions.asScalaBuffer(listEntity).toList(); ClassTag tag = scala.reflect.ClassTag$.MODULE$.apply(m.getEntityClazz()); JavaRDD personRDD = sparkClient.sparkContext.parallelize(s, 1, tag).toJavaRDD(); CassandraJavaUtil.javaFunctions(personRDD) .writerBuilder(m.getSchema(), m.getTableName(), CassandraJavaUtil.mapToRow(m.getEntityClazz())) .saveToCassandra(); return true; } catch (Exception e) { throw new KunderaException("Cannot persist object(s)", e); } }
public ClassManifest<K> keyType() { return (ClassManifest<K>) ClassManifest$.MODULE$.fromClass(Object.class); }