Search in sources :

Example 1 with QueryServicesImpl

use of org.apache.phoenix.query.QueryServicesImpl in project phoenix by apache.

the class PhoenixDriver method getQueryServices.

@Override
public QueryServices getQueryServices() throws SQLException {
    try {
        lockInterruptibly(LockMode.READ);
        checkClosed();
        // Lazy initialize QueryServices so that we only attempt to create an HBase Configuration
        // object upon the first attempt to connect to any cluster. Otherwise, an attempt will be
        // made at driver initialization time which is too early for some systems.
        QueryServices result = services;
        if (result == null) {
            synchronized (this) {
                result = services;
                if (result == null) {
                    services = result = new QueryServicesImpl(getDefaultProps());
                }
            }
        }
        return result;
    } finally {
        unlock(LockMode.READ);
    }
}
Also used : ConnectionlessQueryServicesImpl(org.apache.phoenix.query.ConnectionlessQueryServicesImpl) QueryServicesImpl(org.apache.phoenix.query.QueryServicesImpl) ConnectionQueryServicesImpl(org.apache.phoenix.query.ConnectionQueryServicesImpl) QueryServices(org.apache.phoenix.query.QueryServices) ConnectionQueryServices(org.apache.phoenix.query.ConnectionQueryServices)

Aggregations

ConnectionQueryServices (org.apache.phoenix.query.ConnectionQueryServices)1 ConnectionQueryServicesImpl (org.apache.phoenix.query.ConnectionQueryServicesImpl)1 ConnectionlessQueryServicesImpl (org.apache.phoenix.query.ConnectionlessQueryServicesImpl)1 QueryServices (org.apache.phoenix.query.QueryServices)1 QueryServicesImpl (org.apache.phoenix.query.QueryServicesImpl)1