All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.spark.connector.japi.CassandraJavaUtil Maven / Gradle / Ivy

package com.datastax.spark.connector.japi;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.rdd.RDD;
import scala.Option;
import scala.Tuple1;
import scala.Tuple10;
import scala.Tuple11;
import scala.Tuple12;
import scala.Tuple13;
import scala.Tuple14;
import scala.Tuple15;
import scala.Tuple16;
import scala.Tuple17;
import scala.Tuple18;
import scala.Tuple19;
import scala.Tuple2;
import scala.Tuple20;
import scala.Tuple21;
import scala.Tuple22;
import scala.Tuple3;
import scala.Tuple4;
import scala.Tuple5;
import scala.Tuple6;
import scala.Tuple7;
import scala.Tuple8;
import scala.Tuple9;
import scala.reflect.ClassTag;
import scala.reflect.ClassTag$;
import scala.reflect.api.TypeTags;

import com.datastax.spark.connector.AllColumns$;
import com.datastax.spark.connector.BatchSize;
import com.datastax.spark.connector.BatchSize$;
import com.datastax.spark.connector.BytesInBatch$;
import com.datastax.spark.connector.ColumnName;
import com.datastax.spark.connector.ColumnName$;
import com.datastax.spark.connector.ColumnRef;
import com.datastax.spark.connector.ColumnSelector;
import com.datastax.spark.connector.RowsInBatch$;
import com.datastax.spark.connector.SomeColumns$;
import com.datastax.spark.connector.TTL;
import com.datastax.spark.connector.WriteTime;
import com.datastax.spark.connector.cql.CassandraConnector;
import com.datastax.spark.connector.mapper.ColumnMapper;
import com.datastax.spark.connector.mapper.JavaBeanColumnMapper;
import com.datastax.spark.connector.mapper.TupleColumnMapper;
import com.datastax.spark.connector.rdd.reader.ClassBasedRowReaderFactory;
import com.datastax.spark.connector.rdd.reader.RowReaderFactory;
import com.datastax.spark.connector.rdd.reader.ValueRowReaderFactory;
import com.datastax.spark.connector.types.TypeConverter;
import com.datastax.spark.connector.types.TypeConverter$;
import com.datastax.spark.connector.util.JavaApiHelper;
import com.datastax.spark.connector.util.JavaApiHelper$;
import com.datastax.spark.connector.writer.BatchGroupingKey;
import com.datastax.spark.connector.writer.RowWriterFactory;

import static com.datastax.spark.connector.util.JavaApiHelper.defaultRowWriterFactory;
import static com.datastax.spark.connector.util.JavaApiHelper.javaBeanColumnMapper;

/**
 * The main entry point to Spark Cassandra Connector Java API.
 * 

* There are several helpful static factory methods which build useful wrappers around Spark Context, and * RDD. There are also helper methods to build reader and writer factories which configure their * parameters. */ @SuppressWarnings("UnusedDeclaration") public class CassandraJavaUtil { private CassandraJavaUtil() { assert false; } // ------------------------------------------------------------------------- // Java API wrappers factory methods // ------------------------------------------------------------------------- /** * A static factory method to create a {@link SparkContextJavaFunctions} based on an existing {@link * SparkContext} instance. */ public static SparkContextJavaFunctions javaFunctions(SparkContext sparkContext) { return new SparkContextJavaFunctions(sparkContext); } /** * A static factory method to create a {@link SparkContextJavaFunctions} based on an existing {@link * JavaSparkContext} instance. */ public static SparkContextJavaFunctions javaFunctions(JavaSparkContext sparkContext) { return new SparkContextJavaFunctions(JavaSparkContext.toSparkContext(sparkContext)); } /** * A static factory method to create a {@link RDDJavaFunctions} based on an existing {@link RDD} * instance. */ public static RDDJavaFunctions javaFunctions(RDD rdd) { return new RDDJavaFunctions<>(rdd); } /** * A static factory method to create a {@link RDDJavaFunctions} based on an existing {@link JavaRDD} * instance. */ public static RDDJavaFunctions javaFunctions(JavaRDD rdd) { return new RDDJavaFunctions<>(rdd.rdd()); } /** * A static factory method to create a {@link PairRDDJavaFunctions} based on an existing {@link * JavaPairRDD} instance. */ public static PairRDDJavaFunctions javaFunctions(JavaPairRDD rdd) { return new PairRDDJavaFunctions<>(rdd.rdd()); } // ------------------------------------------------------------------------- // Type tag resolvers // ------------------------------------------------------------------------- public static ClassTag safeClassTag(Class cls) { return JavaApiHelper$.MODULE$.getClassTag(cls); } public static ClassTag classTag(Class cls) { return JavaApiHelper$.MODULE$.getClassTag2(cls); } @SuppressWarnings("unchecked") public static ClassTag anyClassTag() { return (ClassTag) ClassTag$.MODULE$.AnyRef(); } /** * Creates a type tag representing a given class type without any type parameters. */ public static TypeTags.TypeTag safeTypeTag(Class main) { return JavaApiHelper.getTypeTag(main); } /** * Creates a type tag representing a given class type without any type parameters. */ @SuppressWarnings("unchecked") public static TypeTags.TypeTag typeTag(Class main) { return JavaApiHelper.getTypeTag((Class) main); } /** * Creates a type tag representing a given class type with given type parameters. *

* This is the most generic method to create type tags. One can use it to create type tags of * arbitrary class types with any number of type parameters and any depth of type parameter nesting. *

* For example, the following code: {@code typeTag(Map.class, typeTag(String.class), * typeTag(List.class, typeTag(String.class))} returns the type tag of {@code Map>} */ public static TypeTags.TypeTag typeTag( Class main, TypeTags.TypeTag typeParam1, TypeTags.TypeTag... typeParams ) { return JavaApiHelper.getTypeTag(main, ArrayUtils.add(typeParams, 0, typeParam1)); } /** * Creates a type tag representing a given class type with given type parameters. *

* With this factory method you can create type tags of class types with any number of type * parameters. However, the type parameters are class types without their own type parameters. *

* For example, the following code: {@code typeTag(List.class, String.class)} returns a type tag of * {@code List}, and the following code: {@code typeTag(Map.class, String.class, * Integer.class)} returns a type tag of {@code Map}. *

* This is a short-hand method for calling {@link #typeTag(Class, TypeTags.TypeTag, * TypeTags.TypeTag[])} and providing type parameters with {@link #safeTypeTag(Class)}. */ public static TypeTags.TypeTag typeTag(Class main, Class typeParam1, Class... typeParams) { TypeTags.TypeTag[] typeParamsTags = new TypeTags.TypeTag[typeParams.length + 1]; typeParamsTags[0] = typeTag(typeParam1); for (int i = 0; i < typeParams.length; i++) { typeParamsTags[i + 1] = typeTag(typeParams[i]); } return JavaApiHelper.getTypeTag(main, typeParamsTags); } // ------------------------------------------------------------------------- // Type converter resolvers // ------------------------------------------------------------------------- /** * Retrieves a type converter for the given class type. *

* This is a short-hand method for calling {@link #typeConverter(TypeTags.TypeTag)} with an argument * obtained by {@link #safeTypeTag(Class)}. */ public static TypeConverter safeTypeConverter(Class main) { return TypeConverter$.MODULE$.forType(safeTypeTag(main)); } /** * Retrieves a type converter for a type represented by a given type tag. */ @SuppressWarnings("unchecked") public static TypeConverter typeConverter(TypeTags.TypeTag typeTag) { return (TypeConverter) TypeConverter$.MODULE$.forType(typeTag); } /** * Retrieves a type converter for the given class type. *

* This is a short-hand method for calling {@link #typeConverter(TypeTags.TypeTag)} with an argument * obtained by {@link #safeTypeTag(Class)}. */ @SuppressWarnings("unchecked") public static TypeConverter typeConverter(Class main) { return TypeConverter$.MODULE$.forType(CassandraJavaUtil.typeTag(main)); } /** * Retrieves a type converter for the given class type with the given type parameters. *

* This is a short-hand method for calling {@link #typeConverter(TypeTags.TypeTag)} with an argument * obtained by {@link #typeTag(Class, Class, Class[])}. */ @SuppressWarnings("unchecked") public static TypeConverter typeConverter(Class main, Class typeParam1, Class... typeParams) { return TypeConverter$.MODULE$.forType(CassandraJavaUtil.typeTag(main, typeParam1, typeParams)); } /** * Retrieves a type converter for the given class type with the given type parameters. *

* This is a short-hand method for calling {@link #typeConverter(TypeTags.TypeTag)} with an argument * obtained by {@link #typeTag(Class, TypeTags.TypeTag, TypeTags.TypeTag[])}. */ @SuppressWarnings("unchecked") public static TypeConverter typeConverter( Class main, TypeTags.TypeTag typeParam1, TypeTags.TypeTag... typeParams ) { return TypeConverter$.MODULE$.forType(CassandraJavaUtil.typeTag(main, typeParam1, typeParams)); } // ------------------------------------------------------------------------- // Single column mappers // ------------------------------------------------------------------------- /** * Constructs a row reader factory which maps a single column from a row to the instance of a given * class. *

* It is a short-hand method for calling {@link #mapColumnTo(TypeConverter)} with the type converter * resolved by {@link #typeConverter(Class)} method. */ public static RowReaderFactory mapColumnTo(Class targetClass) { return new ValueRowReaderFactory<>(CassandraJavaUtil.typeConverter(targetClass)); } /** * Constructs a row reader factory which maps a single column from a row to the list of objects of a * specified type. *

* The method should be used when we have to deal with a column of some collection type (either a set * or a list). *

* For example the following code: {@code javaFunctions(sc).cassandraTable("ks", "tab", * mapColumnToListOf(String.class))} returns an RDD of {@code List}. *

* It is a short-hand method for calling {@link #mapColumnTo(Class, Class, Class[])} with the main * type being {@link java.util.List} and the type parameter being the given target class. */ public static RowReaderFactory> mapColumnToListOf(Class targetClass) { return new ValueRowReaderFactory<>(CassandraJavaUtil.>typeConverter(List.class, targetClass)); } /** * Constructs a row reader factory which maps a single column from a row to the set of objects of a * specified type. *

* The method should be used when we have to deal with a column of some collection type (either a set * or a list). *

* For example the following code: {@code javaFunctions(sc).cassandraTable("ks", "tab", * mapColumnToSetOf(String.class))} returns an RDD of {@code Set}. *

* It is a short-hand method for calling {@link #mapColumnTo(Class, Class, Class[])} with the main * type being {@link java.util.Set} and the type parameter being the given target class. */ public static RowReaderFactory> mapColumnToSetOf(Class targetClass) { return new ValueRowReaderFactory<>(CassandraJavaUtil.>typeConverter(Set.class, targetClass)); } /** * Constructs a row reader factory which maps a single column from a row to the map of pairs of * specified key and value types. *

* The method should be used when we have to deal with a column of a map type. *

* For example the following code: {@code javaFunctions(sc).cassandraTable("ks", "tab", * mapColumnToMapOf(String.class, Integer.class))} returns an RDD of {@code Map}. *

* It is a short-hand method for calling {@link #mapColumnTo(Class, Class, Class[])} with the main * type being {@link java.util.Map} and the type parameters being the given target key and target * value classes. */ public static RowReaderFactory> mapColumnToMapOf( Class targetKeyClass, Class targetValueClass ) { return new ValueRowReaderFactory<>( CassandraJavaUtil.>typeConverter(Map.class, targetKeyClass, targetValueClass)); } /** * Constructs a row reader factory which maps a single column from a row to the objects of a * specified type with given type parameters. *

* It is a short-hand method for calling {@link #mapColumnTo(TypeConverter)} with a type converter * resolved by calling {@link #typeConverter(Class, Class, Class[])}. */ @SuppressWarnings("unchecked") public static RowReaderFactory mapColumnTo(Class targetClass, Class typeParam1, Class... typeParams) { return new ValueRowReaderFactory<>(CassandraJavaUtil.typeConverter(targetClass, typeParam1, typeParams)); } /** * Constructs a row reader factory which maps a single column from a row using a specified type * converter. *

* Unlike {@code mapRowTo(...)} methods, this method converts the first available column from the * result set. Therefore, it is strongly recommended to explicitly specify the projection on the RDD * in order to decrease the amount of data to be fetched and to make it explicit which column is to * be mapped. */ public static RowReaderFactory mapColumnTo(TypeConverter typeConverter) { return new ValueRowReaderFactory<>(typeConverter); } // ------------------------------------------------------------------------- // Entire row mappers // ------------------------------------------------------------------------- /** * Constructs a row reader factory which maps an entire row to an object of a specified type. *

* The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be overridden by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. *

* Another version of this method {@link #mapRowTo(Class, Pair[])} can be considered much more handy * for inline invocations. *

* The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static RowReaderFactory mapRowTo(Class targetClass, Map columnMapping) { TypeTags.TypeTag tt = typeTag(targetClass); ColumnMapper mapper = javaBeanColumnMapper(safeClassTag(targetClass), columnMapping); return new ClassBasedRowReaderFactory<>(tt, mapper); } /** * Constructs a row reader factory which maps an entire row to an object of a specified type. *

* The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. *

* The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static RowReaderFactory mapRowTo(Class targetClass, Pair... columnMappings) { TypeTags.TypeTag tt = typeTag(targetClass); ColumnMapper mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); } /** * Constructs a row reader factory which maps an entire row using a specified column mapper. Follow * the guide to find out more about column mappers. */ public static RowReaderFactory mapRowTo(Class targetClass, ColumnMapper columnMapper) { TypeTags.TypeTag tt = typeTag(targetClass); return new ClassBasedRowReaderFactory<>(tt, columnMapper); } // ------------------------------------------------------------------------- // Row to tuples mapper // ------------------------------------------------------------------------- /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple1.class, typeTag(a) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple1ColumnMapper(a)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple2.class, typeTag(a), typeTag(b) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple2ColumnMapper(a, b)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple3.class, typeTag(a), typeTag(b), typeTag(c) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple3ColumnMapper(a, b, c)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple4.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple4ColumnMapper(a, b, c, d)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple5.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple5ColumnMapper(a, b, c, d, e)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple6.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple6ColumnMapper(a, b, c, d, e, f)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple7.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple7ColumnMapper(a, b, c, d, e, f, g)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple8.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple8ColumnMapper(a, b, c, d, e, f, g, h)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple9.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple9ColumnMapper(a, b, c, d, e, f, g, h, i)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple10.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple10ColumnMapper(a, b, c, d, e, f, g, h, i, j)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple11.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple11ColumnMapper(a, b, c, d, e, f, g, h, i, j, k)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple12.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple12ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple13.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple13ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple14.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple14ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple15.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple15ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple16.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple16ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple17.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple17ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple18.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple18ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple19.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple19ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple20.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple20ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple21.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t), typeTag(u) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple21ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)); } /** * Creates a RowReaderFactory instance for reading tuples with given parameter types. */ public static RowReaderFactory> mapRowToTuple( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u, Class v ) { final TypeTags.TypeTag> tupleTT = typeTag(Tuple22.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t), typeTag(u), typeTag(v) ); return new ClassBasedRowReaderFactory<>(tupleTT, tuple22ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)); } // ------------------------------------------------------------------------- // Row writer factory creation methods // ------------------------------------------------------------------------- /** * Creates a row writer factory which can map objects supported by a given column mapper to columns * in a table. */ @SuppressWarnings("unchecked") public static RowWriterFactory mapToRow(Class targetClass, ColumnMapper columnMapper) { TypeTags.TypeTag tt = typeTag(targetClass); return defaultRowWriterFactory(tt, columnMapper); } /** * Creates a row writer factory which can map objects supported by a given column mapper to columns * in a table. */ public static RowWriterFactory safeMapToRow(Class targetClass, ColumnMapper columnMapper) { TypeTags.TypeTag tt = safeTypeTag(targetClass); return defaultRowWriterFactory(tt, columnMapper); } /** * Creates a row writer factory which maps objects of a given class type to columns in table. *

* The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. *

* Another version of this method {@link #mapToRow(Class, Pair[])} can be considered much more handy * for inline invocations. *

* The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. */ public static RowWriterFactory mapToRow( Class sourceClass, Map columnNameMappings ) { ColumnMapper mapper = javaBeanColumnMapper(safeClassTag(sourceClass), columnNameMappings); return mapToRow(sourceClass, mapper); } /** * Creates a row writer factory which maps objects of a given class type to columns in table. *

* The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. *

* The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. */ public static RowWriterFactory mapToRow(Class sourceClass, Pair... columnNameMappings) { return mapToRow(sourceClass, convertToMap(columnNameMappings)); } // ------------------------------------------------------------------------- // Tuples to row mapper // ------------------------------------------------------------------------- /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a ) { return mapToRow(Tuple1.class, tuple1ColumnMapper(a)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b ) { return mapToRow(Tuple2.class, tuple2ColumnMapper(a, b)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c ) { return mapToRow(Tuple3.class, tuple3ColumnMapper(a, b, c)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d ) { return mapToRow(Tuple4.class, tuple4ColumnMapper(a, b, c, d)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e ) { return mapToRow(Tuple5.class, tuple5ColumnMapper(a, b, c, d, e)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f ) { return mapToRow(Tuple6.class, tuple6ColumnMapper(a, b, c, d, e, f)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g ) { return mapToRow(Tuple7.class, tuple7ColumnMapper(a, b, c, d, e, f, g)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h ) { return mapToRow(Tuple8.class, tuple8ColumnMapper(a, b, c, d, e, f, g, h)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i ) { return mapToRow(Tuple9.class, tuple9ColumnMapper(a, b, c, d, e, f, g, h, i)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j ) { return mapToRow(Tuple10.class, tuple10ColumnMapper(a, b, c, d, e, f, g, h, i, j)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k ) { return mapToRow(Tuple11.class, tuple11ColumnMapper(a, b, c, d, e, f, g, h, i, j, k)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l ) { return mapToRow(Tuple12.class, tuple12ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m ) { return mapToRow(Tuple13.class, tuple13ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n ) { return mapToRow(Tuple14.class, tuple14ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o ) { return mapToRow(Tuple15.class, tuple15ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p ) { return mapToRow(Tuple16.class, tuple16ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q ) { return mapToRow(Tuple17.class, tuple17ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r ) { return mapToRow(Tuple18.class, tuple18ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s ) { return mapToRow(Tuple19.class, tuple19ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t ) { return mapToRow(Tuple20.class, tuple20ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u ) { return mapToRow(Tuple21.class, tuple21ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)); } /** * Creates a RowWriterFactory instance for writing tuples with given parameter types. */ public static RowWriterFactory> mapTupleToRow( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u, Class v ) { return mapToRow(Tuple22.class, tuple22ColumnMapper(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)); } // ------------------------------------------------------------------------- // Batch size factory methods and constants // ------------------------------------------------------------------------- /** * The default automatic batch size. */ public static final BatchSize automaticBatchSize = BatchSize$.MODULE$.Automatic(); /** * Creates a batch size which bases on the given number of rows - the total batch size in bytes * doesn't matter in this case. */ public static BatchSize rowsInBatch(int batchSizeInRows) { return RowsInBatch$.MODULE$.apply(batchSizeInRows); } /** * Creates a batch size which bases on total size in bytes - the number of rows doesn't matter in * this case. */ public static BatchSize bytesInBatch(int batchSizeInBytes) { return BytesInBatch$.MODULE$.apply(batchSizeInBytes); } public static final BatchGroupingKey BATCH_GROUPING_KEY_NONE = BatchGroupingKey.None$.MODULE$; public static final BatchGroupingKey BATCH_GROUPING_KEY_PARTITION = BatchGroupingKey.Partition$.MODULE$; public static final BatchGroupingKey BATCH_GROUPING_KEY_REPLICA_SET = BatchGroupingKey.ReplicaSet$.MODULE$; // ------------------------------------------------------------------------- // Column selector factory methods and constants // ------------------------------------------------------------------------- /** * Column selector to select all the columns from a table. */ public static final ColumnSelector allColumns = AllColumns$.MODULE$; /** * Creates a column selector with a given columns projection. */ public static ColumnSelector someColumns(String... columnNames) { ColumnRef[] columnsSelection = new ColumnRef[columnNames.length]; for (int i = 0; i < columnNames.length; i++) { columnsSelection[i] = ColumnName$.MODULE$.apply(columnNames[i], Option.empty()); } return SomeColumns$.MODULE$.apply(JavaApiHelper.toScalaImmutableSeq(columnsSelection)); } public static ColumnName column(String columnName) { return new ColumnName(columnName, Option.empty()); } public static TTL ttl(String columnName) { return new TTL(columnName, Option.empty()); } public static WriteTime writeTime(String columnName) { return new WriteTime(columnName, Option.empty()); } public static ColumnRef[] toSelectableColumnRefs(String... columnNames) { ColumnName[] refs = new ColumnName[columnNames.length]; for (int i = 0; i < columnNames.length; i++) { refs[i] = column(columnNames[i]); } return refs; } // ------------------------------------------------------------------------- // Utility methods // ------------------------------------------------------------------------- /** * A simple method that converts an array of pairs into a map. */ public static Map convertToMap(Pair[] pairs) { Map map = new HashMap<>(); for (Pair pair : pairs) map.put(String.valueOf(pair.getKey()), String.valueOf(pair.getValue())); return map; } /** * A simple method which wraps the given connector instance into Option. */ public static Option connector(CassandraConnector connector) { return Option.apply(connector); } // ------------------------------------------------------------------------- // Tuple column mappers // ------------------------------------------------------------------------- /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple1ColumnMapper( Class a ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple1.class, typeTag(a) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple2ColumnMapper( Class a, Class b ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple2.class, typeTag(a), typeTag(b) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple3ColumnMapper( Class a, Class b, Class c ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple3.class, typeTag(a), typeTag(b), typeTag(c) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple4ColumnMapper( Class a, Class b, Class c, Class d ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple4.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple5ColumnMapper( Class a, Class b, Class c, Class d, Class e ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple5.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple6ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple6.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple7ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple7.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple8ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple8.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple9ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple9.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple10ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple10.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple11ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple11.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple12ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple12.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple13ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple13.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple14ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple14.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple15ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple15.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple16ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple16.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple17ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple17.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple18ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple18.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple19ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple19.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple20ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple20.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple21ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple21.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t), typeTag(u) ); return new TupleColumnMapper<>(typeTag); } /** * Provides a column mapper for the tuple with given parameter types. */ public static TupleColumnMapper> tuple22ColumnMapper( Class a, Class b, Class c, Class d, Class e, Class f, Class g, Class h, Class i, Class j, Class k, Class l, Class m, Class n, Class o, Class

p, Class q, Class r, Class s, Class t, Class u, Class v ) { final TypeTags.TypeTag> typeTag = typeTag(Tuple22.class, typeTag(a), typeTag(b), typeTag(c), typeTag(d), typeTag(e), typeTag(f), typeTag(g), typeTag(h), typeTag(i), typeTag(j), typeTag(k), typeTag(l), typeTag(m), typeTag(n), typeTag(o), typeTag(p), typeTag(q), typeTag(r), typeTag(s), typeTag(t), typeTag(u), typeTag(v) ); return new TupleColumnMapper<>(typeTag); } }