@Override public RecordReader getRecordReader() { try { _recordReader.rewind(); } catch (Exception e) { LOGGER.error("Caught exception while rewinding record reader", e); Utils.rethrowException(e); } return _recordReader; } }
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"); }
ControllerGauge(String unit, boolean global) { this.unit = unit; this.global = global; this.gaugeName = Utils.toCamelCase(name().toLowerCase()); }
public void start() { LOGGER.info("Starting Pinot controller"); Utils.logVersions(); PinotFSFactory.init(pinotFSConfig); } catch (Exception e) { Utils.rethrowException(e);
/** * 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()); } }
/** * 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); }
@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)); } }
@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); } } }
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; } }
MinionMeter(String unit, boolean global) { _meterName = Utils.toCamelCase(name().toLowerCase()); _unit = unit; _global = global; }
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; } }
/** * 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; }
ServerMeter(String unit, boolean global) { this.unit = unit; this.global = global; this.meterName = Utils.toCamelCase(name().toLowerCase()); }
throws Exception { LOGGER.info("Starting Pinot minion: {}", _instanceId); Utils.logVersions(); MinionContext minionContext = MinionContext.getInstance();
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; }
BrokerGauge(String unit, boolean global) { this.unit = unit; this.global = global; this.brokerGaugeName = Utils.toCamelCase(name().toLowerCase()); }
Utils.logVersions(); ServerConf serverInstanceConfig = DefaultHelixStarterServerConfig.getDefaultHelixServerConfig(_helixServerConfig);
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"); } } }
ControllerMeter(String unit, boolean global) { this.unit = unit; this.global = global; this.brokerMeterName = Utils.toCamelCase(name().toLowerCase()); }