public boolean runWithCheckedExceptions() throws IOException {
        HTable liveCubeTable = null;
        try {
                
            HBaseSnapshotter hbaseSnapshotter = new HBaseSnapshotter(conf, liveDataTableName, cf, snapshotTableName, 
                    new Path("/tmp/snapshot_hfiles"), false, null, null);
            try {
                if(!hbaseSnapshotter.runWithCheckedExceptions()) {
                    log.error("Snapshotter failed. Returning false.");
                    return false;
                }
            } catch (InterruptedException e) {
                log.error("Snapshotter interrupted. Returning false.");
                return false;
            }
            long snapshotFinishMs = System.currentTimeMillis();
            
            /*
             * Create a table to backfill into. Use the same region boundaries as the live data table
             */
            HBaseAdmin hbaseAdmin = new HBaseAdmin(conf);
            if(hbaseAdmin.tableExists(backfillTableName)) {
                log.error("Backfill table " + new String(backfillTableName) + " shouldn't already exist");
                return false;
            }
            
            liveCubeTable = new HTable(conf, liveDataTableName);
            byte[][] startKeys = liveCubeTable.getStartKeys();
            
            // The region split keys are all the region start keys, except the first.
            List<byte[]> splitKeys = new ArrayList<byte[]>();
            for(int i=1; i<startKeys.length; i++) {
                splitKeys.add(startKeys[i]);
            }
            
            HColumnDescriptor cfDesc = new HColumnDescriptor(cf);
            cfDesc.setBloomFilterType(BloomType.NONE);
            cfDesc.setCompressionType(Algorithm.NONE); // TODO switch to snappy in 0.92
            cfDesc.setMaxVersions(1);
            HTableDescriptor tableDesc = new HTableDescriptor(backfillTableName);
            tableDesc.addFamily(cfDesc);
            hbaseAdmin.createTable(tableDesc, splitKeys.toArray(new byte[][]{}));
            
            backfillCallback.backfillInto(conf, backfillTableName, cf, snapshotFinishMs);

            HBaseBackfillMerger backfillMerger = new HBaseBackfillMerger(conf, 
                    ArrayUtils.EMPTY_BYTE_ARRAY, liveDataTableName, snapshotTableName, 
                    backfillTableName, cf, opDeserializerCls);
            try {
                if(!backfillMerger.runWithCheckedExceptions()) {
                    log.error("Backfill merger failed. Returning false.");
                }
            } catch (InterruptedException e) {
                log.error("Backfill merger was interrupted, returning false");
                return false;
            }
            
            log.debug("Backfill complete");
            return true;
        } finally {
            if(liveCubeTable != null) {
                liveCubeTable.close();
            }
        }
        
    }
public boolean runWithCheckedExceptions ( ) throws IOException { HTable liveCubeTable = null ; try { HBaseSnapshotter hbaseSnapshotter = new HBaseSnapshotter ( conf , liveDataTableName , cf , snapshotTableName , new Path ( "/tmp/snapshot_hfiles" ) , false , null , null ) ; try { if ( ! hbaseSnapshotter . runWithCheckedExceptions ( ) ) { log . error ( "Snapshotter failed. Returning false." ) ; return false ; } } catch ( InterruptedException e ) { log . error ( "Snapshotter interrupted. Returning false." ) ; return false ; } long snapshotFinishMs = System . currentTimeMillis ( ) ; HBaseAdmin hbaseAdmin = new HBaseAdmin ( conf ) ; if ( hbaseAdmin . tableExists ( backfillTableName ) ) { log . error ( "Backfill table " + new String ( backfillTableName ) + " shouldn't already exist" ) ; return false ; } liveCubeTable = new HTable ( conf , liveDataTableName ) ; byte [ ] [ ] startKeys = liveCubeTable . getStartKeys ( ) ; List < byte [ ] > splitKeys = new ArrayList < byte [ ] > ( ) ; for ( int i = 1 ; i < startKeys . length ; i ++ ) { splitKeys . add ( startKeys [ i ] ) ; } HColumnDescriptor cfDesc = new HColumnDescriptor ( cf ) ; cfDesc . setBloomFilterType ( BloomType . NONE ) ; cfDesc . setCompressionType ( Algorithm . NONE ) ; cfDesc . setMaxVersions ( 1 ) ; HTableDescriptor tableDesc = new HTableDescriptor ( backfillTableName ) ; tableDesc . addFamily ( cfDesc ) ; hbaseAdmin . createTable ( tableDesc , splitKeys . toArray ( new byte [ ] [ ] { } ) ) ; backfillCallback . backfillInto ( conf , backfillTableName , cf , snapshotFinishMs ) ; HBaseBackfillMerger backfillMerger = new HBaseBackfillMerger ( conf , ArrayUtils . EMPTY_BYTE_ARRAY , liveDataTableName , snapshotTableName , backfillTableName , cf , opDeserializerCls ) ; try { if ( ! backfillMerger . runWithCheckedExceptions ( ) ) { log . error ( "Backfill merger failed. Returning false." ) ; } } catch ( InterruptedException e ) { log . error ( "Backfill merger was interrupted, returning false" ) ; return false ; } log . debug ( "Backfill complete" ) ; return true ; } finally { if ( liveCubeTable != null ) { liveCubeTable . close ( ) ; } } }
@return whether successful