Class CouchbaseMetadataProcessor

  • All Implemented Interfaces:
    org.teiid.translator.MetadataProcessor<org.teiid.couchbase.CouchbaseConnection>

    public class CouchbaseMetadataProcessor
    extends Object
    implements org.teiid.translator.MetadataProcessor<org.teiid.couchbase.CouchbaseConnection>
    • Field Detail

      • IS_ARRAY_TABLE

        @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
        See Also:
        Constant Field Values
      • NAMED_TYPE_PAIR

        @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
        See Also:
        Constant Field Values
    • Constructor Detail

      • CouchbaseMetadataProcessor

        public CouchbaseMetadataProcessor()
    • Method Detail

      • process

        public void process​(org.teiid.metadata.MetadataFactory mf,
                            org.teiid.couchbase.CouchbaseConnection conn)
                     throws org.teiid.translator.TranslatorException
        Specified by:
        process in interface org.teiid.translator.MetadataProcessor<org.teiid.couchbase.CouchbaseConnection>
        Throws:
        org.teiid.translator.TranslatorException
      • scanRow

        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.
        Parameters:
        key - - The attribute name in document, which mapped with value
        value - - JsonObject/JsonArray which may contain nested JsonObject/JsonArray
        mf -
        table -
        referenceTableName - - The top table name, used to add foreign key
        isNestedType - - Whether the jsonValue are a nested value, or the jsonValue is a segment of document
        dimension - - The dimension of nested array, for example, "{"nestedArray": [[["nestedArray"]]]}", the dimension deepest array is 3
      • addProcedures

        protected void addProcedures​(org.teiid.metadata.MetadataFactory metadataFactory,
                                     org.teiid.couchbase.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)