Examples of HBaseConnectionImpl


Examples of com.alibaba.druid.hdriver.impl.HBaseConnectionImpl

        HEngine engine = HEngine.getHEngine(url, info);

        info.put("hbase.zookeeper.quorum", rest);

        return new HBaseConnectionImpl(engine, info);
    }
View Full Code Here

Examples of com.alibaba.druid.hdriver.impl.HBaseConnectionImpl

        HEngine engine = HEngine.getHEngine(url, info);

        info.put("hbase.zookeeper.quorum", rest);

        return new HBaseConnectionImpl(engine, info);
    }
View Full Code Here

Examples of com.alibaba.druid.hdriver.impl.HBaseConnectionImpl

            HMapping mapping = this.getMapping();
            if (mapping == null) {
                mapping = new HMappingDefaultImpl();
            }

            HBaseConnectionImpl connection = statement.getConnection();

            scan = new Scan();
            this.statement = statement;

            Filter filter = null;
            for (SQLExpr item : conditions) {
                SQLBinaryOpExpr condition = (SQLBinaryOpExpr) item;
                filter = setFilter(condition, filter, true);
            }
            if (filter != null) {
                scan.setFilter(filter);
            }

            HTableInterface htable = connection.getHTable(getTableName());
            ResultScanner scanner = htable.getScanner(scan);

            HScannerResultSetImpl resultSet = new HScannerResultSetImpl(statement, htable, scanner);
            resultSet.setMetaData(resultMetaData);
View Full Code Here

Examples of com.alibaba.druid.hdriver.impl.HBaseConnectionImpl

            HMapping mapping = this.getMapping();
            if (mapping == null) {
                mapping = new HMappingDefaultImpl();
            }
           
            HBaseConnectionImpl connection = statement.getConnection();
            String dbType = connection.getConnectProperties().getProperty("dbType");

            Put put = null;
            for (Map.Entry<String, SQLExpr> entry : columns.entrySet()) {
                String column = entry.getKey();
                SQLExpr valueExpr = entry.getValue();

                Object value = SQLEvalVisitorUtils.eval(dbType, valueExpr, statement.getParameters());

                if (value == null) {
                    continue;
                }
               
                byte[] bytes = mapping.toBytes(column, value);

                if (mapping.isRow(column)) {
                    put = new Put(bytes);
                } else {
                    byte[] family = mapping.getFamily(column);
                    byte[] qualifier = mapping.getQualifier(column);
                    put.add(family, qualifier, bytes);
                }
            }

            HTableInterface htable = connection.getHTable(getTableName());
            htable.put(put);

            return false;
        } catch (SQLException e) {
            throw e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.