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

org.apache.phoenix.parse.CreateIndexStatement Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.phoenix.parse;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.apache.hadoop.hbase.util.Pair;
import org.apache.phoenix.schema.PTable.IndexType;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;


public class CreateIndexStatement extends SingleTableStatement {
    private final TableName indexTableName;
    private final IndexKeyConstraint indexKeyConstraint;
    private final List includeColumns;
    private final List splitNodes;
    private final ListMultimap> props;
    private final boolean ifNotExists;
    private final IndexType indexType;
    private final boolean async;
    private final Map udfParseNodes;

    public CreateIndexStatement(NamedNode indexTableName, NamedTableNode dataTable, 
            IndexKeyConstraint indexKeyConstraint, List includeColumns, List splits,
            ListMultimap> props, boolean ifNotExists, IndexType indexType, boolean async, int bindCount, Map udfParseNodes) {
        super(dataTable, bindCount);
        this.indexTableName =TableName.create(dataTable.getName().getSchemaName(),indexTableName.getName());
        this.indexKeyConstraint = indexKeyConstraint == null ? IndexKeyConstraint.EMPTY : indexKeyConstraint;
        this.includeColumns = includeColumns == null ? Collections.emptyList() : includeColumns;
        this.splitNodes = splits == null ? Collections.emptyList() : splits;
        this.props = props == null ? ArrayListMultimap.>create() : props;
        this.ifNotExists = ifNotExists;
        this.indexType = indexType;
        this.async = async;
        this.udfParseNodes = udfParseNodes;
    }

    public IndexKeyConstraint getIndexConstraint() {
        return indexKeyConstraint;
    }

    public List getIncludeColumns() {
        return includeColumns;
    }

    public TableName getIndexTableName() {
        return indexTableName;
    }

    public List getSplitNodes() {
        return splitNodes;
    }

    public ListMultimap> getProps() {
        return props;
    }

    public boolean ifNotExists() {
        return ifNotExists;
    }


    public IndexType getIndexType() {
        return indexType;
    }

    public boolean isAsync() {
        return async;
    }

    public Map getUdfParseNodes() {
        return udfParseNodes;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy