Refine search
long startcode = conf.getLong("startcode", System.currentTimeMillis()); String listenPort = conf.get("hbase.rest.port", "8080"); out.print( listenPort ); out.write("</small></h1>\n </div>\n </div>\n <div class=\"row\">\n\n <section>\n <h2>Software Attributes</h2>\n <table id=\"attributes_table\" class=\"table table-striped\">\n <tr>\n <th>Attribute Name</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n <tr>\n <td>HBase Version</td>\n <td>"); out.print( VersionInfo.getVersion() ); out.write(", revision="); out.print( VersionInfo.getRevision() ); out.write("</td>\n <td>HBase version and revision</td>\n </tr>\n <tr>\n <td>HBase Compiled</td>\n <td>"); out.print( VersionInfo.getDate() ); out.write(','); out.write(' '); out.print( VersionInfo.getUser() ); out.write("</td>\n <td>When HBase version was compiled and by whom</td>\n </tr>\n <tr>\n <td>REST Server Start Time</td>\n <td>"); out.print( new Date(startcode) );
VersionInfo.logVersion(); Configuration conf = HBaseConfiguration.create(); UserProvider userProvider = UserProvider.instantiate(conf); int maxThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MAX, 100); int minThreads = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREADS_MIN, 2); int queueSize = servlet.getConfiguration().getInt(REST_THREAD_POOL_TASK_QUEUE_SIZE, -1); int idleTimeout = servlet.getConfiguration().getInt(REST_THREAD_POOL_THREAD_IDLE_TIMEOUT, 60000); QueuedThreadPool threadPool = queueSize > 0 ?
static String[] versionReport() { return new String[] { "HBase " + getVersion(), "Source code repository " + getUrl() + " revision=" + getRevision(), "Compiled by " + getUser() + " on " + getDate(), "From source with checksum " + getSrcChecksum() }; }
Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); for (Entry<String,String> entry : services.getProps()) { config.set(entry.getKey(), entry.getValue()); config.set((String) key, info.getProperty((String) key)); config.set(entry.getKey(), entry.getValue()); String hbaseVersion = VersionInfo.getVersion(); this.kvBuilder = KeyValueBuilder.get(hbaseVersion); this.returnSequenceValues = props.getBoolean(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, QueryServicesOptions.DEFAULT_RETURN_SEQUENCE_VALUES);
private static void checkDefaultsVersion(Configuration conf) { if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return; String defaultsVersion = conf.get("hbase.defaults.for.version"); String thisVersion = VersionInfo.getVersion(); if (!thisVersion.equals(defaultsVersion)) { throw new RuntimeException( "hbase-default.xml file seems to be for an older version of HBase (" + defaultsVersion + "), this version is " + thisVersion); } }
@Test public void testCorrectlyCleansUpResources() throws Exception{ ExecutorService exec = Executors.newFixedThreadPool(1); RegionCoprocessorEnvironment e =Mockito.mock(RegionCoprocessorEnvironment.class); Configuration conf =new Configuration(); Mockito.when(e.getConfiguration()).thenReturn(conf); Mockito.when(e.getSharedData()).thenReturn(new ConcurrentHashMap<String,Object>()); FakeTableFactory factory = new FakeTableFactory( Collections.<ImmutableBytesPtr, Table> emptyMap()); TrackingParallelWriterIndexCommitter writer = new TrackingParallelWriterIndexCommitter(VersionInfo.getVersion()); Stoppable mockStop = Mockito.mock(Stoppable.class); // create a simple writer writer.setup(factory, exec, mockStop,e); // stop the writer writer.stop(this.test.getTableNameString() + " finished"); assertTrue("Factory didn't get shutdown after writer#stop!", factory.shutdown); assertTrue("ExectorService isn't terminated after writer#stop!", exec.isShutdown()); Mockito.verifyZeroInteractions(mockStop); }
private static void setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); // This is primarily used by Dataflow where connections open and close often. This is a // performance optimization that will reduce the cost to open connections. boolean useCachedDataPool = configuration.getBoolean(BIGTABLE_USE_CACHED_DATA_CHANNEL_POOL, false); builder.setUseCachedDataPool(useCachedDataPool); // This information is in addition to bigtable-client-core version, and jdk version. StringBuilder agentBuilder = new StringBuilder(); agentBuilder.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuilder.append(',').append(customUserAgent); } builder.setUserAgent(agentBuilder.toString()); }
@Override public void start() throws Exception { VersionInfo.logVersion(); Configuration conf = builder.getHbaseConfiguration(); conf.set("hbase.rest.port", hbaseRestPort.toString()); conf.set("hbase.rest.readonly", (hbaseRestReadOnly == null) ? "true" : hbaseRestReadOnly.toString()); conf.set("hbase.rest.info.port", (hbaseRestInfoPort == null) ? "8085" : hbaseRestInfoPort.toString()); String hbaseRestHost = (this.hbaseRestHost == null) ? "0.0.0.0" : this.hbaseRestHost;
Log LOG = LogFactory.getLog("RESTServer"); VersionInfo.logVersion(); Configuration conf = HBaseConfiguration.create(); DNS.getDefaultHost(conf.get("hbase.rest.dns.interface", "default"), conf.get("hbase.rest.dns.nameserver", "default"))); User.login(conf, "hbase.rest.keytab.file", "hbase.rest.kerberos.principal", machineName); String val = commandLine.getOptionValue("port"); servlet.getConfiguration() .setInt("hbase.rest.port", Integer.valueOf(val)); LOG.debug("port set to " + val);
Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); for (Entry<String,String> entry : services.getProps()) { config.set(entry.getKey(), entry.getValue()); config.set(entry.getKey(), entry.getValue()); this.props = new ReadOnlyProps(this.config.iterator()); try { this.connection = HBaseFactoryProvider.getHConnectionFactory().createConnection(this.config); String hbaseVersion = VersionInfo.getVersion(); this.kvBuilder = KeyValueBuilder.get(hbaseVersion);
IndexTestingUtils.setupConfig(conf); String version = VersionInfo.getVersion(); conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, false); conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
!env.getConfiguration().getBoolean(QueryServices.ALLOW_LOCAL_INDEX_ATTRIB, QueryServicesOptions.DEFAULT_ALLOW_LOCAL_INDEX)) { builder.setReturnCode(MetaDataProtos.MutationCode.UNALLOWED_LOCAL_INDEXES); Cell cell = cells.get(0); String autoPartitionWhere = QueryUtil.getViewPartitionClause(MetaDataUtil.getAutoPartitionColumnName(parentTable), autoPartitionNum); String hbaseVersion = VersionInfo.getVersion(); ImmutableBytesPtr ptr = new ImmutableBytesPtr(); KeyValueBuilder kvBuilder = KeyValueBuilder.get(hbaseVersion);
/** * @see org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine */ public static void main(String[] args) throws Exception { LOG.info("STARTING executorService " + HRegionServer.class.getSimpleName()); VersionInfo.logVersion(); Configuration conf = HBaseConfiguration.create(); @SuppressWarnings("unchecked") Class<? extends HRegionServer> regionServerClass = (Class<? extends HRegionServer>) conf .getClass(HConstants.REGION_SERVER_IMPL, HRegionServer.class); new HRegionServerCommandLine(regionServerClass).doMain(args); }
/** @return the HBase release */ @Override public String getHBaseVersion() { return VersionInfo.getVersion(); }
public static void main(String [] args) throws Exception { LOG.info("***** STARTING service '" + ThriftServer.class.getSimpleName() + "' *****"); VersionInfo.logVersion(); final Configuration conf = HBaseConfiguration.create(); // for now, only time we return is on an argument error. final int status = ToolRunner.run(conf, new ThriftServer(conf), args); LOG.info("***** STOPPING service '" + ThriftServer.class.getSimpleName() + "' *****"); System.exit(status); } }
Configuration config = HBaseFactoryProvider.getConfigurationFactory().getConfiguration(); for (Entry<String,String> entry : services.getProps()) { config.set(entry.getKey(), entry.getValue()); config.set((String) key, info.getProperty((String) key)); config.set(entry.getKey(), entry.getValue()); String hbaseVersion = VersionInfo.getVersion(); this.kvBuilder = KeyValueBuilder.get(hbaseVersion); this.returnSequenceValues = props.getBoolean(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, QueryServicesOptions.DEFAULT_RETURN_SEQUENCE_VALUES);
private static void checkDefaultsVersion(Configuration conf) { if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return; String defaultsVersion = conf.get("hbase.defaults.for.version"); String thisVersion = VersionInfo.getVersion(); if (!thisVersion.equals(defaultsVersion)) { throw new RuntimeException( "hbase-default.xml file seems to be for an older version of HBase (" + defaultsVersion + "), this version is " + thisVersion); } }
@Test public void testCorrectlyCleansUpResources() throws Exception{ ExecutorService exec = Executors.newFixedThreadPool(1); FakeTableFactory factory = new FakeTableFactory( Collections.<ImmutableBytesPtr, Table> emptyMap()); TrackingParallelWriterIndexCommitter writer = new TrackingParallelWriterIndexCommitter(VersionInfo.getVersion()); Stoppable mockStop = Mockito.mock(Stoppable.class); RegionCoprocessorEnvironment e =Mockito.mock(RegionCoprocessorEnvironment.class); Configuration conf =new Configuration(); Mockito.when(e.getConfiguration()).thenReturn(conf); Mockito.when(e.getSharedData()).thenReturn(new ConcurrentHashMap<String,Object>()); // create a simple writer writer.setup(factory, exec, mockStop, e); // stop the writer writer.stop(this.test.getTableNameString() + " finished"); assertTrue("Factory didn't get shutdown after writer#stop!", factory.shutdown); assertTrue("ExectorService isn't terminated after writer#stop!", exec.isShutdown()); Mockito.verifyZeroInteractions(mockStop); }
private static void setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); // This is primarily used by Dataflow where connections open and close often. This is a // performance optimization that will reduce the cost to open connections. boolean useCachedDataPool = configuration.getBoolean(BIGTABLE_USE_CACHED_DATA_CHANNEL_POOL, false); builder.setUseCachedDataPool(useCachedDataPool); // This information is in addition to bigtable-client-core version, and jdk version. StringBuilder agentBuilder = new StringBuilder(); agentBuilder.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuilder.append(',').append(customUserAgent); } builder.setUserAgent(agentBuilder.toString()); }
IndexTestingUtils.setupConfig(conf); String version = VersionInfo.getVersion(); conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, false); conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);