Search in sources :

Example 1 with LeaveIndexActiveFailurePolicy

use of org.apache.phoenix.hbase.index.write.LeaveIndexActiveFailurePolicy in project phoenix by apache.

the class PhoenixTransactionalIndexer method start.

@Override
public void start(CoprocessorEnvironment e) throws IOException {
    final RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) e;
    String serverName = env.getRegionServerServices().getServerName().getServerName();
    codec = new PhoenixIndexCodec();
    codec.initialize(env);
    // setup the actual index writer
    // For transactional tables, we keep the index active upon a write failure
    // since we have the all versus none behavior for transactions.
    this.writer = new IndexWriter(new LeaveIndexActiveFailurePolicy(), env, serverName + "-tx-index-writer");
}
Also used : RegionCoprocessorEnvironment(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment) IndexWriter(org.apache.phoenix.hbase.index.write.IndexWriter) LeaveIndexActiveFailurePolicy(org.apache.phoenix.hbase.index.write.LeaveIndexActiveFailurePolicy)

Aggregations

RegionCoprocessorEnvironment (org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment)1 IndexWriter (org.apache.phoenix.hbase.index.write.IndexWriter)1 LeaveIndexActiveFailurePolicy (org.apache.phoenix.hbase.index.write.LeaveIndexActiveFailurePolicy)1