Package org.teiid.translator.couchbase
Class CouchbaseMetadataProcessor
- java.lang.Object
-
- org.teiid.translator.couchbase.CouchbaseMetadataProcessor
-
- All Implemented Interfaces:
MetadataProcessor<CouchbaseConnection>
public class CouchbaseMetadataProcessor extends Object implements MetadataProcessor<CouchbaseConnection>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CouchbaseMetadataProcessor.Dimension
The dimension of nested array, a dimension is a hint of nested array table name, and index name.
-
Field Summary
Fields Modifier and Type Field Description static String
IS_ARRAY_TABLE
static String
NAMED_TYPE_PAIR
-
Fields inherited from interface org.teiid.translator.MetadataProcessor
FQN, SOURCE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description CouchbaseMetadataProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addProcedures(MetadataFactory metadataFactory, CouchbaseConnection connection)
String
getSampleKeyspaces()
int
getSampleSize()
String
getTypeNameList()
void
process(MetadataFactory mf, CouchbaseConnection conn)
protected void
scanRow(String key, String keyInSource, com.couchbase.client.java.document.json.JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, CouchbaseMetadataProcessor.Dimension dimension)
A dispatcher of scan jsonValue(document, of a segment of document), the jsonValue either can be a JsonObject, or JsonArray, different type dispatch to different scan method.void
setSampleKeyspaces(String sampleKeyspaces)
void
setSampleSize(int sampleSize)
void
setTypeNameList(String typeNameList)
void
setUseDouble(boolean useDouble)
-
-
-
Field Detail
-
IS_ARRAY_TABLE
@ExtensionMetadataProperty(applicable=Table.class, datatype=java.lang.Boolean.class, display="Is Array Table", description="Declare whether the table is array table") public static final String IS_ARRAY_TABLE
- See Also:
- Constant Field Values
-
NAMED_TYPE_PAIR
@ExtensionMetadataProperty(applicable=Table.class, datatype=java.lang.String.class, display="Named Type Pair", description="Declare the name of typed key/value pair") public static final String NAMED_TYPE_PAIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
process
public void process(MetadataFactory mf, CouchbaseConnection conn) throws TranslatorException
- Specified by:
process
in interfaceMetadataProcessor<CouchbaseConnection>
- Throws:
TranslatorException
-
scanRow
protected void scanRow(String key, String keyInSource, com.couchbase.client.java.document.json.JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, CouchbaseMetadataProcessor.Dimension dimension)
A dispatcher of scan jsonValue(document, of a segment of document), the jsonValue either can be a JsonObject, or JsonArray, different type dispatch to different scan method.- Parameters:
key
- - The attribute name in document, which mapped with valuevalue
- - JsonObject/JsonArray which may contain nested JsonObject/JsonArraymf
-table
-referenceTableName
- - The top table name, used to add foreign keyisNestedType
- - Whether the jsonValue are a nested value, or the jsonValue is a segment of documentdimension
- - The dimension of nested array, for example, "{"nestedArray": [[["nestedArray"]]]}", the dimension deepest array is 3
-
addProcedures
protected void addProcedures(MetadataFactory metadataFactory, CouchbaseConnection connection)
-
getSampleSize
@TranslatorProperty(display="SampleSize", category=IMPORT, description="Maximum number of documents per keyspace that should be map") public int getSampleSize()
-
setSampleSize
public void setSampleSize(int sampleSize)
-
getTypeNameList
@TranslatorProperty(display="TypeNameList", category=IMPORT, description="A comma-separated list of the attributes that the buckets use to specify document types. Each list item must be a bucket name surrounded by back quotes (`), a colon (:), and an attribute name surrounded by back quotes (`).") public String getTypeNameList()
-
setTypeNameList
public void setTypeNameList(String typeNameList)
-
getSampleKeyspaces
@TranslatorProperty(display="SampleKeyspaces", category=IMPORT, description="A comma-separated list of the keyspace names to define which keyspaces that should be map, default map all keyspaces") public String getSampleKeyspaces()
-
setSampleKeyspaces
public void setSampleKeyspaces(String sampleKeyspaces)
-
setUseDouble
public void setUseDouble(boolean useDouble)
-
-