Пример #1
0
 public String forServerTenantCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants?type=server");
 }
Пример #2
0
 public String forInstanceBulkCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "instances", "bulkAdd");
 }
Пример #3
0
 // V2 API started
 public String forTenantCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants/");
 }
Пример #4
0
 public String forInstanceCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "instances/");
 }
Пример #5
0
 public String forInstanceEnable(String instanceName) {
   return StringUtil.join(
       "/", StringUtils.chomp(_baseUrl, "/"), "instances", instanceName, "?state=enable");
 }
Пример #6
0
 public String forBrokerTenantGet(String tenantName) {
   return StringUtil.join(
       "/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName, "?type=broker");
 }
Пример #7
0
 public String forDataFileUpload() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments");
 }
Пример #8
0
 public String forTableDelete(String tableName) {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName);
 }
Пример #9
0
 public String forResourceCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "dataresources");
 }
Пример #10
0
 public String forTableGetBrokerInstances(String tableName) {
   return StringUtil.join(
       "/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "instances?type=broker");
 }
Пример #11
0
 public String forTableGet(String tableName) {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "instances");
 }
Пример #12
0
 public String forTableGetConfig(String tableName) {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables", tableName, "configs");
 }
Пример #13
0
 public String forTableCreate() {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tables");
 }
Пример #14
0
 public String forServerTenantDelete(String tenantName) {
   return StringUtil.join(
       "/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName, "?type=server");
 }
Пример #15
0
 public String forBrokerTenantCreate(String tenantName) {
   return StringUtil.join(
       "/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName, "instances?type=broker");
 }
Пример #16
0
 public String forResourceGet(String resourceName) {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "dataresources", resourceName);
 }
Пример #17
0
 public String forTenantGet(String tenantName) {
   return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName);
 }
Пример #18
0
  public HelixBrokerStarter(
      String helixClusterName, String zkServer, Configuration pinotHelixProperties)
      throws Exception {
    _liveInstancesListener = new LiveInstancesChangeListenerImpl(helixClusterName);

    _pinotHelixProperties = DefaultHelixBrokerConfig.getDefaultBrokerConf(pinotHelixProperties);
    final String brokerId =
        _pinotHelixProperties.getString(
            "instanceId",
            CommonConstants.Helix.PREFIX_OF_BROKER_INSTANCE
                + NetUtil.getHostAddress()
                + "_"
                + _pinotHelixProperties.getInt(
                    CommonConstants.Helix.KEY_OF_BROKER_QUERY_PORT,
                    CommonConstants.Helix.DEFAULT_BROKER_QUERY_PORT));

    _pinotHelixProperties.addProperty("pinot.broker.id", brokerId);
    RoutingTableBuilder defaultOfflineRoutingTableBuilder =
        getRoutingTableBuilder(
            _pinotHelixProperties.subset(DEFAULT_OFFLINE_ROUTING_TABLE_BUILDER_KEY));
    RoutingTableBuilder defaultRealtimeRoutingTableBuilder =
        getRoutingTableBuilder(
            _pinotHelixProperties.subset(DEFAULT_REALTIME_ROUTING_TABLE_BUILDER_KEY));
    Map<String, RoutingTableBuilder> tableToRoutingTableBuilderMap =
        getTableToRoutingTableBuilderMap(_pinotHelixProperties.subset(ROUTING_TABLE_BUILDER_KEY));
    ZkClient zkClient =
        new ZkClient(
            StringUtil.join(
                "/", StringUtils.chomp(zkServer, "/"), helixClusterName, "PROPERTYSTORE"),
            ZkClient.DEFAULT_SESSION_TIMEOUT,
            ZkClient.DEFAULT_CONNECTION_TIMEOUT,
            new ZNRecordSerializer());
    _propertyStore =
        new ZkHelixPropertyStore<ZNRecord>(new ZkBaseDataAccessor<ZNRecord>(zkClient), "/", null);
    _helixExternalViewBasedRouting =
        new HelixExternalViewBasedRouting(
            defaultOfflineRoutingTableBuilder,
            defaultRealtimeRoutingTableBuilder,
            tableToRoutingTableBuilderMap,
            _propertyStore);

    // _brokerServerBuilder = startBroker();
    _brokerServerBuilder = startBroker(_pinotHelixProperties);
    _helixManager =
        HelixManagerFactory.getZKHelixManager(
            helixClusterName, brokerId, InstanceType.PARTICIPANT, zkServer);
    final StateMachineEngine stateMachineEngine = _helixManager.getStateMachineEngine();
    final StateModelFactory<?> stateModelFactory =
        new BrokerResourceOnlineOfflineStateModelFactory(
            _helixManager, _helixExternalViewBasedRouting);
    stateMachineEngine.registerStateModelFactory(
        BrokerResourceOnlineOfflineStateModelFactory.getStateModelDef(), stateModelFactory);
    _helixManager.connect();
    _helixAdmin = _helixManager.getClusterManagmentTool();
    _helixBrokerRoutingTable =
        new HelixBrokerRoutingTable(_helixExternalViewBasedRouting, brokerId, _helixManager);
    addInstanceTagIfNeeded(helixClusterName, brokerId);
    _helixManager.addExternalViewChangeListener(_helixBrokerRoutingTable);
    _helixManager.addInstanceConfigChangeListener(_helixBrokerRoutingTable);
    _helixManager.addLiveInstanceChangeListener(_liveInstancesListener);
  }