public class CouchbaseMetadataProcessor extends Object implements org.teiid.translator.MetadataProcessor<org.teiid.couchbase.CouchbaseConnection>
| Modifier and Type | Class and Description |
|---|---|
static class |
CouchbaseMetadataProcessor.Dimension
The dimension of nested array, a dimension is a hint of nested array table name, and index name.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
IS_ARRAY_TABLE |
static String |
NAMED_TYPE_PAIR |
| Constructor and Description |
|---|
CouchbaseMetadataProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addProcedures(org.teiid.metadata.MetadataFactory metadataFactory,
org.teiid.couchbase.CouchbaseConnection connection) |
String |
getSampleKeyspaces() |
int |
getSampleSize() |
String |
getTypeNameList() |
void |
process(org.teiid.metadata.MetadataFactory mf,
org.teiid.couchbase.CouchbaseConnection conn) |
protected void |
scanRow(String key,
String keyInSource,
com.couchbase.client.java.document.json.JsonValue value,
org.teiid.metadata.MetadataFactory mf,
org.teiid.metadata.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) |
@ExtensionMetadataProperty(applicable=org.teiid.metadata.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
@ExtensionMetadataProperty(applicable=org.teiid.metadata.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
public void process(org.teiid.metadata.MetadataFactory mf,
org.teiid.couchbase.CouchbaseConnection conn)
throws org.teiid.translator.TranslatorException
process in interface org.teiid.translator.MetadataProcessor<org.teiid.couchbase.CouchbaseConnection>org.teiid.translator.TranslatorExceptionprotected void scanRow(String key, String keyInSource, com.couchbase.client.java.document.json.JsonValue value, org.teiid.metadata.MetadataFactory mf, org.teiid.metadata.Table table, String referenceTableName, boolean isNestedType, CouchbaseMetadataProcessor.Dimension dimension)
key - - The attribute name in document, which mapped with valuevalue - - JsonObject/JsonArray which may contain nested JsonObject/JsonArraymf - conn - 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 3protected void addProcedures(org.teiid.metadata.MetadataFactory metadataFactory,
org.teiid.couchbase.CouchbaseConnection connection)
@TranslatorProperty(display="SampleSize",
category=IMPORT,
description="Maximum number of documents per keyspace that should be map")
public int getSampleSize()
public void setSampleSize(int sampleSize)
@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()
public void setTypeNameList(String typeNameList)
@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()
public void setSampleKeyspaces(String sampleKeyspaces)
public void setUseDouble(boolean useDouble)
Copyright © 2017 JBoss by Red Hat. All rights reserved.