Gets a scanner for a specific table

@param tableName
to get the scanner from
@param scan
for the specific table
@param conf
object to get a hold of an HBase table
334926
@Override
    public ResultScanner getScanner(final String tableName, final Scan scan)
    {
        logger.debug("TEPHRA Begin of getScanner(" + tableName + ", " + scan + ")");
        final TransactionAwareHTable txTable = (TransactionAwareHTable) getTable(tableName);
        ResultScanner resScanner = null;
        try {
            resScanner = txTable.getScanner(scan);
        } catch (final IOException e) {
            logger.error("Error while trying to obtain a ResultScanner: " + tableName);
            logger.error(e.getMessage());
        }
        return resScanner;
    }
1196260
public Entity getEntityBySchemaAndTableName(String schemaName, String tableName) {
        return currentEntitiesBySchemaAndTableName.get(Table.keyForMap(schemaName, tableName));
    }
520632
@Override
	public String onTableName(String tableName) {
		if (onlyBindParameter)
			return null;

		if (currentSchema != null) {
			Finder<SQLProperty> finder = currentSchema.getEntityBySimpleName(tableName);
			AssertKripton.assertTrueOrUnknownClassInJQLException(finder != null, currentMethod, tableName);
			return finder.getTableName();
		} else {
			return null;
		}
	}
561007
private List<HBaseDataWrapper> scanResults(final String tableName, List<HBaseDataWrapper> results)
            throws IOException
    {
        if (fetchSize == null)
        {
            for (Result result : scanner)
            {
                HBaseDataWrapper data = new HBaseDataWrapper(tableName, result.getRow());
                data.setColumns(result.listCells());
                results.add(data);
            }

            scanner = null;
            resultsIter = null;
        }
        return results;
    }
448359
private void checkAndCreateTable(final String tabName, final String colFamName)
            throws IOException
    {
        hbaseUtils.checkAndCreateTable(tabName, colFamName);
    }
400275
@Override
    public <E> List<E> getColumnsById(String schemaName, String tableName, String pKeyColumnName, String columnName,
        Object pKeyColumnValue, Class columnJavaType) {
        // select columnName from tableName where pKeyColumnName =
        // pKeyColumnValue
        List results = new ArrayList();
        CQLTranslator translator = new CQLTranslator();
        String selectQuery = translator.SELECT_QUERY;
        selectQuery = StringUtils.replace(selectQuery, CQLTranslator.COLUMN_FAMILY,
            translator.ensureCase(new StringBuilder(), tableName, false).toString());
        selectQuery = StringUtils.replace(selectQuery, CQLTranslator.COLUMNS,
            translator.ensureCase(new StringBuilder(), columnName, false).toString());

        StringBuilder selectQueryBuilder = new StringBuilder(selectQuery);

        selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);

        translator.buildWhereClause(selectQueryBuilder, columnJavaType, pKeyColumnName, pKeyColumnValue,
            CQLTranslator.EQ_CLAUSE, false);
        selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),
            selectQueryBuilder.length());

        ResultSet rSet = execute(selectQueryBuilder.toString(), null);

        Iterator<Row> rowIter = rSet.iterator();
        while (rowIter.hasNext()) {
            Row row = rowIter.next();
            DataType dataType = row.getColumnDefinitions().getType(columnName);
            Object columnValue =
                DSClientUtilities.assign(row, null, null, dataType.getName(), null, columnName, null, null);
            results.add(columnValue);
        }
        return results;
    }
229230
public static long countRows(Configuration conf, byte[] tableName) throws IOException {
        HTable hTable = null;
        ResultScanner rs = null;
        long count = 0;
        try {
            hTable = new HTable(conf, tableName);
            rs = hTable.getScanner(new Scan());
            for(@SuppressWarnings("unused") Result r: rs) {
                count++;
            }
            return count;
        } finally {
            if(hTable != null) {
                hTable.close();
            }
            if(rs != null) {
                rs.close();
            }
        }
    }
563874
protected static ResultSet getColumnMetaData (Connection conn, String table, String column)
        throws SQLException
    {
        ResultSet rs = conn.getMetaData().getColumns("", "", table, column);
        while (rs.next()) {
            String tname = rs.getString("TABLE_NAME");
            String cname = rs.getString("COLUMN_NAME");
            if (tname.equals(table) && cname.equals(column)) {
                return rs;
            }
        }
        throw new SQLException("Table or Column not defined. [table=" + table +
                               ", col=" + column + "].");
    }
638750
@Override
    public java.util.concurrent.Future<ScanResult> scanAsync(String tableName, java.util.List<String> attributesToGet) {

        return scanAsync(new ScanRequest().withTableName(tableName).withAttributesToGet(attributesToGet));
    }
983712
public Query adapt(Scan scan) {
    ReadHooks readHooks = new DefaultReadHooks();
    Query query = Query.create(bigtableTableName.getTableId());
    Adapters.SCAN_ADAPTER.adapt(scan, readHooks, query);
    readHooks.applyPreSendHook(query);
    return query;
  }
1349417
public void checkAndCreateTable(String tabName, String colFamName) throws IOException {
        HBaseAdmin hba;
        try {
            hba = new HBaseAdmin(this.getHbcfg());
            if (hba.tableExists(tabName) == false) {
                logger.debug("creating table " + tabName);
                final HTableDescriptor tableDescriptor = new HTableDescriptor(tabName);
                final HColumnDescriptor columnDescriptor = new HColumnDescriptor(colFamName);
		columnDescriptor.setMaxVersions(MAX_VALUE);
		tableDescriptor.addFamily(columnDescriptor);
                hba.createTable(tableDescriptor);
            } else {
                logger.debug("already existent table " + tabName);
            }
            hba.close();
        } catch (MasterNotRunningException e) {
            throw new IOException(e);
        } catch (ZooKeeperConnectionException e) {
            throw new IOException(e);
        } catch (IOException e) {
            throw new IOException(e);
        }
    }
635557
@Override
    protected void validate(List<TableInfo> tableInfos)
    {
        try
        {
            if (isNamespaceAvailable(databaseName))
            {
                for (TableInfo tableInfo : tableInfos)
                {
                    if (tableInfo != null)
                    {
                        HTableDescriptor hTableDescriptor = admin.getTableDescriptor((databaseName + ":" + tableInfo
                                .getTableName()).getBytes());
                        boolean columnFamilyFound = false;
                        Boolean f = false;
                        for (HColumnDescriptor columnDescriptor : hTableDescriptor.getColumnFamilies())
                        {

                            if (!columnFamilyFound
                                    && columnDescriptor.getNameAsString().equalsIgnoreCase(tableInfo.getTableName()))
                            {
                                columnFamilyFound = true;
                            }

                            for (CollectionColumnInfo cci : tableInfo.getCollectionColumnMetadatas())
                            {
                                if (columnDescriptor.getNameAsString().equalsIgnoreCase(cci.getCollectionColumnName()))
                                {
                                    f = true;
                                    break;
                                }

                            }
                            if (!(columnFamilyFound || f))
                            {
                                throw new SchemaGenerationException("column " + tableInfo.getTableName()
                                        + " does not exist in table " + databaseName + "", "Hbase", databaseName,
                                        tableInfo.getTableName());
                            }
                            // TODO make a check for sec table
                        }

                    }
                }
            }
            else
            {
                throw new SchemaGenerationException("Namespace" + databaseName + "does not exist", "HBase",
                        databaseName);
            }

        }
        catch (TableNotFoundException tnfex)
        {
            throw new SchemaGenerationException("table " + databaseName + " does not exist ", tnfex, "Hbase");
        }
        catch (IOException ioe)
        {
            logger.error("Either check for network connection or table isn't in enabled state, Caused by:", ioe);
            throw new SchemaGenerationException(ioe, "Hbase");
        }
    }
235921
private int getTableIndex(String tableName) {

        int index;

        // System.out.println("begin searching for "+tableName);
        for (index = 0; index < vHoldTableNames.size(); index++) {

            // System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
            if (tableName.equals((String) vHoldTableNames.elementAt(index))) {
                return index;
            }    // end of if (tableName.equals(vHoldTableNames.elementAt(index)))
        }        // end of for (index = 0; index < vHoldTableNames.size(); index ++)

        return -1;
    }
55386
public Scan getResultScan(String tableName, String famName,
             ByteBuffer startKey, ByteBuffer endKey) throws IOException {
	 logger.debug("AbstractHBaseUtils Begin of getResultScan(" + tableName + ", " + famName + ")");
         Scan scan = new Scan();
         scan.addFamily(Bytes.toBytes(famName));
         // For a range scan, set start / stop id or just start.
         if (startKey != null)
             scan.setStartRow(Bytes.toBytes(startKey));
         if (endKey != null)
             scan.setStopRow(Bytes.toBytes(endKey));
         return scan;
     }
663684
@Override
    public HTable getTable(String tableName) {
	logger.debug("NATIVE Begin of getTable for " + tableName);
        HTable table = tableNameHandleMap.get(tableName);
        if (table != null) {
            logger.debug("NATIVE Found a cached handle for table " + tableName);
            return table;
        }
        try {
            logger.debug("NATIVE Looking for a handle of table: " + tableName);
            HBaseAdmin admin = new HBaseAdmin(this.getHbcfg());
            HTableDescriptor[] resources = admin.listTables(tableName);
	    Preconditions.checkElementIndex(0, resources.length, "no table " + tableName + " found");
            admin.close();
            table = new HTable(this.getHbcfg(), tableName);
        } catch (IOException e) {
            logger.error("NATIVE Error while trying to obtain table: " + tableName);
            logger.error(e.getMessage());
        };
        tableNameHandleMap.put(tableName, table);
        logger.debug("NATIVE Cached a handle of table: " + tableName);
        return table;
    }
462884
private Referenceable getTableReference(Table hiveTable)  throws Exception {
        LOG.debug("Getting reference for table {}.{}", hiveTable.getDbName(), hiveTable.getTableName());

        String typeName = HiveDataTypes.HIVE_TABLE.getName();
        String tblQualifiedName = getTableQualifiedName(getClusterName(), hiveTable.getDbName(), hiveTable.getTableName());
        return getEntityReference(typeName, tblQualifiedName);
    }
1246761
function getTable(trxOrKnex, tableName, schemaName) {
  return schemaName
    ? trxOrKnex(tableName).withSchema(schemaName)
    : trxOrKnex(tableName);
}