本文整理了Java中org.apache.pinot.common.Utils
类的一些代码示例,展示了Utils
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils
类的具体详情如下:
包路径:org.apache.pinot.common.Utils
类名称:Utils
暂无
代码示例来源:origin: apache/incubator-pinot
@Override
public RecordReader getRecordReader() {
try {
_recordReader.rewind();
} catch (Exception e) {
LOGGER.error("Caught exception while rewinding record reader", e);
Utils.rethrowException(e);
}
return _recordReader;
}
}
代码示例来源:origin: apache/incubator-pinot
public void start() {
LOGGER.info("Starting Pinot Broker");
Utils.logVersions();
Preconditions.checkState(_state.get() == State.INIT);
_state.set(State.STARTING);
_brokerRequestHandler.start();
_brokerAdminApplication.start(_config
.getInt(CommonConstants.Helix.KEY_OF_BROKER_QUERY_PORT, CommonConstants.Helix.DEFAULT_BROKER_QUERY_PORT));
_state.set(State.RUNNING);
LOGGER.info("Pinot Broker started");
}
代码示例来源:origin: apache/incubator-pinot
ControllerGauge(String unit, boolean global) {
this.unit = unit;
this.global = global;
this.gaugeName = Utils.toCamelCase(name().toLowerCase());
}
代码示例来源:origin: apache/incubator-pinot
public void start() {
LOGGER.info("Starting Pinot controller");
Utils.logVersions();
PinotFSFactory.init(pinotFSConfig);
} catch (Exception e) {
Utils.rethrowException(e);
代码示例来源:origin: apache/incubator-pinot
/**
* Write the version of Pinot components to the log at info level.
*/
public static void logVersions() {
for (Map.Entry<String, String> titleVersionEntry : getComponentVersions().entrySet()) {
LOGGER.info("Using {} {}", titleVersionEntry.getKey(), titleVersionEntry.getValue());
}
}
代码示例来源:origin: apache/incubator-pinot
/**
* Rethrows an exception, even if it is not in the method signature.
*
* @param t The exception to rethrow.
*/
public static void rethrowException(Throwable t) {
/* Error can be thrown anywhere and is type erased on rethrowExceptionInner, making the cast in
rethrowExceptionInner a no-op, allowing us to rethrow the exception without declaring it. */
Utils.<Error>rethrowExceptionInner(t);
}
代码示例来源:origin: apache/incubator-pinot
@Override
protected void initChannel(SocketChannel ch)
throws Exception {
LOGGER.info("Setting up Server channel, scheduler");
ch.pipeline().addLast("decoder", new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));
ch.pipeline().addLast("encoder", new LengthFieldPrepender(4));
//ch.pipeline().addLast("logger", new LoggingHandler());
// Create server metric for this handler and add to aggregate if present
NettyServerMetrics serverMetric =
new NettyServerMetrics(_registry, NettyTCPServer.class.getName() + "_" + Utils.getUniqueId() + "_");
if (null != _globalMetrics) {
_globalMetrics.addTransportClientMetrics(serverMetric);
}
ch.pipeline().addLast("request_handler",
new NettyChannelInboundHandler(_handlerFactory.createNewRequestHandler(), serverMetric,
_defaultLargeQueryLatencyMs));
}
}
代码示例来源:origin: apache/incubator-pinot
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get version number of Pinot components")
@ApiResponses(value = {@ApiResponse(code = 200, message = "Success")})
public String getVersionNumber() {
try {
return JsonUtils.objectToString(Utils.getComponentVersions());
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: apache/incubator-pinot
private KeyManager[] setupKeyManagers() {
if (_keyStoreFile == null) {
return null;
}
try {
KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE);
LOGGER.info("Setting up keystore with file {}", _keyStoreFile);
keyStore.load(new FileInputStream(new File(_keyStoreFile)), _keyStorePassword.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KEYMANAGER_FACTORY_ALGORITHM);
kmf.init(keyStore, _keyStorePassword.toCharArray());
LOGGER.info("Successfully initialized keystore");
return kmf.getKeyManagers();
} catch (Exception e) {
Utils.rethrowException(e);
}
return null;
}
}
代码示例来源:origin: apache/incubator-pinot
MinionMeter(String unit, boolean global) {
_meterName = Utils.toCamelCase(name().toLowerCase());
_unit = unit;
_global = global;
}
代码示例来源:origin: apache/incubator-pinot
Utils.logVersions();
代码示例来源:origin: apache/incubator-pinot
public PinotControllerResponseFilter() {
String controllerHost = NetUtil.getHostnameOrAddress();
if (controllerHost != null) {
_controllerHost = controllerHost;
} else {
_controllerHost = UNKNOWN;
}
String controllerVersion = Utils.getComponentVersions().get(CONTROLLER_COMPONENT);
if (controllerVersion != null) {
_controllerVersion = controllerVersion;
} else {
_controllerVersion = UNKNOWN;
}
}
代码示例来源:origin: apache/incubator-pinot
/**
* Merge all HLLs in list to the first HLL in the list, the list must contain at least one element
* @param resultList
* @return
*/
public static HyperLogLog mergeHLLResultsToFirstInList(List<HyperLogLog> resultList) {
HyperLogLog hllResult = resultList.get(0);
for (int i = 1; i < resultList.size(); ++i) {
try {
hllResult.addAll(resultList.get(i));
} catch (CardinalityMergeException e) {
Utils.rethrowException(e);
}
}
return hllResult;
}
代码示例来源:origin: apache/incubator-pinot
ServerMeter(String unit, boolean global) {
this.unit = unit;
this.global = global;
this.meterName = Utils.toCamelCase(name().toLowerCase());
}
代码示例来源:origin: apache/incubator-pinot
throws Exception {
LOGGER.info("Starting Pinot minion: {}", _instanceId);
Utils.logVersions();
MinionContext minionContext = MinionContext.getInstance();
代码示例来源:origin: apache/incubator-pinot
public SSLContext generate() {
SSLContext sslContext = null;
try {
TrustManager[] trustManagers = setupTrustManagers();
KeyManager[] keyManagers = setupKeyManagers();
sslContext = SSLContext.getInstance(SECURITY_ALGORITHM);
sslContext.init(keyManagers, trustManagers, null);
} catch (Exception e) {
Utils.rethrowException(e);
}
return sslContext;
}
代码示例来源:origin: apache/incubator-pinot
BrokerGauge(String unit, boolean global) {
this.unit = unit;
this.global = global;
this.brokerGaugeName = Utils.toCamelCase(name().toLowerCase());
}
代码示例来源:origin: apache/incubator-pinot
Utils.logVersions();
ServerConf serverInstanceConfig = DefaultHelixStarterServerConfig.getDefaultHelixServerConfig(_helixServerConfig);
代码示例来源:origin: apache/incubator-pinot
public String sendPQLRaw(String url, String pqlRequest, String traceEnabled) {
try {
final long startTime = System.currentTimeMillis();
ObjectNode bqlJson = JsonUtils.newObjectNode().put("pql", pqlRequest);
if (traceEnabled != null && !traceEnabled.isEmpty()) {
bqlJson.put("trace", traceEnabled);
}
final String pinotResultString = sendPostRaw(url, bqlJson.toString(), null);
final long bqlQueryTime = System.currentTimeMillis() - startTime;
LOGGER.info("BQL: " + pqlRequest + " Time: " + bqlQueryTime);
return pinotResultString;
} catch (final Exception ex) {
LOGGER.error("Caught exception in sendPQLRaw", ex);
Utils.rethrowException(ex);
throw new AssertionError("Should not reach this");
}
}
}
代码示例来源:origin: apache/incubator-pinot
ControllerMeter(String unit, boolean global) {
this.unit = unit;
this.global = global;
this.brokerMeterName = Utils.toCamelCase(name().toLowerCase());
}
内容来源于网络,如有侵权,请联系作者删除!