public class CouchbaseMetadataProcessor extends Object implements MetadataProcessor<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 |
FQN, SOURCE_PREFIX
Constructor and Description |
---|
CouchbaseMetadataProcessor() |
Modifier and Type | Method and 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) |
@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
@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
public void process(MetadataFactory mf, CouchbaseConnection conn) throws TranslatorException
process
in interface MetadataProcessor<CouchbaseConnection>
TranslatorException
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)
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(MetadataFactory metadataFactory, 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 © 2018 JBoss by Red Hat. All rights reserved.