Tabnine Logo
TableNameBuilder.tableNameWithType
Code IndexAdd Tabnine to your IDE (free)

How to use
tableNameWithType
method
in
org.apache.pinot.common.config.TableNameBuilder

Best Java code snippets using org.apache.pinot.common.config.TableNameBuilder.tableNameWithType (Showing top 20 results out of 315)

origin: apache/incubator-pinot

public String getGroupId(String resourceName) {
 return _groupIdMap.get(TableNameBuilder.REALTIME.tableNameWithType(resourceName));
}
origin: apache/incubator-pinot

@Nullable
public static TableConfig getRealtimeTableConfig(@Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore,
  @Nonnull String tableName) {
 return getTableConfig(propertyStore, TableNameBuilder.REALTIME.tableNameWithType(tableName));
}
origin: apache/incubator-pinot

@Nullable
public static TableConfig getOfflineTableConfig(@Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore,
  @Nonnull String tableName) {
 return getTableConfig(propertyStore, TableNameBuilder.OFFLINE.tableNameWithType(tableName));
}
origin: apache/incubator-pinot

@Nullable
public static OfflineSegmentZKMetadata getOfflineSegmentZKMetadata(
  @Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore, @Nonnull String tableName, @Nonnull String segmentName) {
 String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(tableName);
 ZNRecord znRecord = propertyStore
   .get(constructPropertyStorePathForSegment(offlineTableName, segmentName), null, AccessOption.PERSISTENT);
 if (znRecord == null) {
  return null;
 }
 return new OfflineSegmentZKMetadata(znRecord);
}
origin: apache/incubator-pinot

public void updateMetadataConfigFor(String tableName, TableType type, TableCustomConfig newConfigs)
  throws Exception {
 String tableNameWithType = TableNameBuilder.forType(type).tableNameWithType(tableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 if (tableConfig == null) {
  throw new RuntimeException("Table: " + tableName + " of type: " + type + " does not exist");
 }
 tableConfig.setCustomConfig(newConfigs);
 setExistingTableConfig(tableConfig, tableNameWithType, type);
}
origin: apache/incubator-pinot

public void updateSegmentsValidationAndRetentionConfigFor(String tableName, TableType type,
  SegmentsValidationAndRetentionConfig newConfigs)
  throws Exception {
 String tableNameWithType = TableNameBuilder.forType(type).tableNameWithType(tableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 if (tableConfig == null) {
  throw new RuntimeException("Table: " + tableName + " of type: " + type + " does not exist");
 }
 tableConfig.setValidationConfig(newConfigs);
 setExistingTableConfig(tableConfig, tableNameWithType, type);
}
origin: apache/incubator-pinot

private void removeNewSegments()
  throws Exception {
 for (int i = 0; i < 10; i++) {
  _helixResourceManager
    .deleteSegment(TableNameBuilder.OFFLINE.tableNameWithType(TABLE_NAME), NEW_SEGMENT_PREFIX + i);
 }
}
origin: apache/incubator-pinot

@Test
public void testBrokerDebugOutput()
  throws Exception {
 String tableName = getTableName();
 Assert.assertNotNull(getDebugInfo("debug/timeBoundary/" + tableName));
 Assert.assertNotNull(getDebugInfo("debug/timeBoundary/" + TableNameBuilder.OFFLINE.tableNameWithType(tableName)));
 Assert.assertNotNull(getDebugInfo("debug/timeBoundary/" + TableNameBuilder.REALTIME.tableNameWithType(tableName)));
 Assert.assertNotNull(getDebugInfo("debug/routingTable/" + tableName));
 Assert.assertNotNull(getDebugInfo("debug/routingTable/" + TableNameBuilder.OFFLINE.tableNameWithType(tableName)));
 Assert.assertNotNull(getDebugInfo("debug/routingTable/" + TableNameBuilder.REALTIME.tableNameWithType(tableName)));
}
origin: apache/incubator-pinot

public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  OfflineSegmentZKMetadata offlineSegmentZKMetadata, int expectedVersion) {
 // NOTE: Helix will throw ZkBadVersionException if version does not match
 try {
  return propertyStore.set(constructPropertyStorePathForSegment(
    TableNameBuilder.OFFLINE.tableNameWithType(offlineSegmentZKMetadata.getTableName()),
    offlineSegmentZKMetadata.getSegmentName()), offlineSegmentZKMetadata.toZNRecord(), expectedVersion,
    AccessOption.PERSISTENT);
 } catch (ZkBadVersionException e) {
  return false;
 }
}
origin: apache/incubator-pinot

protected void dropRealtimeTable(String tableName)
  throws Exception {
 sendDeleteRequest(
   _controllerRequestURLBuilder.forTableDelete(TableNameBuilder.REALTIME.tableNameWithType(tableName)));
}
origin: apache/incubator-pinot

public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  OfflineSegmentZKMetadata offlineSegmentZKMetadata) {
 return propertyStore.set(constructPropertyStorePathForSegment(
   TableNameBuilder.OFFLINE.tableNameWithType(offlineSegmentZKMetadata.getTableName()),
   offlineSegmentZKMetadata.getSegmentName()), offlineSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}
origin: apache/incubator-pinot

public static boolean setRealtimeSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  RealtimeSegmentZKMetadata realtimeSegmentZKMetadata) {
 return propertyStore.set(constructPropertyStorePathForSegment(
   TableNameBuilder.REALTIME.tableNameWithType(realtimeSegmentZKMetadata.getTableName()),
   realtimeSegmentZKMetadata.getSegmentName()), realtimeSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}
origin: apache/incubator-pinot

protected void dropOfflineTable(String tableName)
  throws Exception {
 sendDeleteRequest(
   _controllerRequestURLBuilder.forTableDelete(TableNameBuilder.OFFLINE.tableNameWithType(tableName)));
}
origin: apache/incubator-pinot

 private boolean allSegmentsPushedToIdealState(String tableName, int segmentNum) {
  IdealState idealState =
    _helixAdmin.getResourceIdealState(HELIX_CLUSTER_NAME, TableNameBuilder.OFFLINE.tableNameWithType(tableName));
  return idealState != null && idealState.getPartitionSet() != null
    && idealState.getPartitionSet().size() == segmentNum;
 }
}
origin: apache/incubator-pinot

private boolean validateNumSegments(int numSegments) {
 String tableNameWithType = TableNameBuilder.OFFLINE.tableNameWithType(TABLE_NAME);
 IdealState idealState = _helixAdmin.getResourceIdealState(getHelixClusterName(), tableNameWithType);
 return idealState.getRecord().getMapFields().keySet().size() == numSegments;
}
origin: apache/incubator-pinot

/**
 * Helper method to create an OFFLINE broker request from the given hybrid broker request.
 * <p>This step will attach the time boundary to the request.
 */
private BrokerRequest getOfflineBrokerRequest(BrokerRequest hybridBrokerRequest) {
 BrokerRequest offlineRequest = hybridBrokerRequest.deepCopy();
 String rawTableName = hybridBrokerRequest.getQuerySource().getTableName();
 String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(rawTableName);
 offlineRequest.getQuerySource().setTableName(offlineTableName);
 attachTimeBoundary(rawTableName, offlineRequest, true);
 return offlineRequest;
}
origin: apache/incubator-pinot

/**
 * Helper method to create a REALTIME broker request from the given hybrid broker request.
 * <p>This step will attach the time boundary to the request.
 */
private BrokerRequest getRealtimeBrokerRequest(BrokerRequest hybridBrokerRequest) {
 BrokerRequest realtimeRequest = hybridBrokerRequest.deepCopy();
 String rawTableName = hybridBrokerRequest.getQuerySource().getTableName();
 String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(rawTableName);
 realtimeRequest.getQuerySource().setTableName(realtimeTableName);
 attachTimeBoundary(rawTableName, realtimeRequest, false);
 return realtimeRequest;
}
origin: apache/incubator-pinot

private boolean allSegmentsPushedToIdealState(String tableName, int segmentNum) {
 IdealState idealState =
   _helixAdmin.getResourceIdealState(getHelixClusterName(), TableNameBuilder.OFFLINE.tableNameWithType(tableName));
 return idealState != null && idealState.getPartitionSet() != null
   && idealState.getPartitionSet().size() == segmentNum;
}
origin: apache/incubator-pinot

@Test
public void testSegmentFlushSize()
  throws Exception {
 String zkSegmentsPath = "/SEGMENTS/" + TableNameBuilder.REALTIME.tableNameWithType(getTableName());
 List<String> segmentNames = _propertyStore.getChildNames(zkSegmentsPath, 0);
 for (String segmentName : segmentNames) {
  ZNRecord znRecord = _propertyStore.get(zkSegmentsPath + "/" + segmentName, null, 0);
  Assert.assertEquals(znRecord.getSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE),
    Integer.toString(getRealtimeSegmentFlushSize() / getNumKafkaPartitions()),
    "Segment: " + segmentName + " does not have the expected flush size");
 }
}
origin: apache/incubator-pinot

 private void updateTableConfig(int targetNumInstancePerPartition, int targetNumReplicaGroup)
   throws IOException {
  String tableNameWithType = TableNameBuilder.OFFLINE.tableNameWithType(TABLE_NAME);
  TableConfig tableConfig = _helixResourceManager.getTableConfig(TABLE_NAME, CommonConstants.Helix.TableType.OFFLINE);
  tableConfig.getValidationConfig().getReplicaGroupStrategyConfig()
    .setNumInstancesPerPartition(targetNumInstancePerPartition);
  tableConfig.getValidationConfig().setReplication(Integer.toString(targetNumReplicaGroup));
  _helixResourceManager
    .setExistingTableConfig(tableConfig, tableNameWithType, CommonConstants.Helix.TableType.OFFLINE);
 }
}
org.apache.pinot.common.configTableNameBuildertableNameWithType

Javadoc

Get the table name with type suffix.

Popular methods of TableNameBuilder

  • extractRawTableName
    Extract the raw table name from the given table name with type suffix.
  • getTableTypeFromTableName
    Get the table type based on the given table name with type suffix.
  • forType
    Get the table name builder for the given table type.
  • isTableResource
    Return whether the given resource name represents a table resource.
  • tableHasTypeSuffix
    Return Whether the table has type suffix that matches the builder type.

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now