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

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

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

origin: apache/incubator-pinot

 private List<String> getAllTables() {
  List<String> tableNames = new ArrayList<>();
  List<String> resources = helixAdmin.getResourcesInCluster(clusterName);
  for (String resourceName : resources) {
   if (TableNameBuilder.isTableResource(resourceName)) {
    tableNames.add(resourceName);
   }
  }
  return tableNames;
 }
}
origin: apache/incubator-pinot

/**
 * Get all Pinot table names (server resources).
 *
 * @return List of Pinot table names
 */
@Nonnull
public List<String> getAllTables() {
 List<String> tableNames = new ArrayList<>();
 for (String resourceName : getAllResources()) {
  if (TableNameBuilder.isTableResource(resourceName)) {
   tableNames.add(resourceName);
  }
 }
 return tableNames;
}
origin: apache/incubator-pinot

/**
 * Get all Pinot raw table names.
 *
 * @return Set of Pinot raw table names
 */
@Nonnull
public List<String> getAllRawTables() {
 Set<String> rawTableNames = new HashSet<>();
 for (String resourceName : getAllResources()) {
  if (TableNameBuilder.isTableResource(resourceName)) {
   rawTableNames.add(TableNameBuilder.extractRawTableName(resourceName));
  }
 }
 return new ArrayList<>(rawTableNames);
}
origin: apache/incubator-pinot

/**
 * Delete a list of segments from ideal state and remove them from the local storage.
 *
 * @param tableNameWithType Table name with type suffix
 * @param segmentNames List of names of segment to be deleted
 * @return Request response
 */
@Nonnull
public synchronized PinotResourceManagerResponse deleteSegments(@Nonnull String tableNameWithType,
  @Nonnull List<String> segmentNames) {
 try {
  LOGGER.info("Trying to delete segments: {} from table: {} ", segmentNames, tableNameWithType);
  Preconditions.checkArgument(TableNameBuilder.isTableResource(tableNameWithType),
    "Table name: %s is not a valid table name with type suffix", tableNameWithType);
  HelixHelper.removeSegmentsFromIdealState(_helixZkManager, tableNameWithType, segmentNames);
  _segmentDeletionManager.deleteSegments(tableNameWithType, segmentNames);
  return PinotResourceManagerResponse.success("Segment " + segmentNames + " deleted");
 } catch (final Exception e) {
  LOGGER.error("Caught exception while deleting segment: {} from table: {}", segmentNames, tableNameWithType, e);
  return PinotResourceManagerResponse.failure(e.getMessage());
 }
}
origin: apache/incubator-pinot

if (!TableNameBuilder.isTableResource(resourceName)) {
 continue;
origin: apache/incubator-pinot

private Set<String> fetchLatestTableResources(HelixAdmin helixAdmin) {
 Set<String> resourcesToMonitor = new HashSet<>();
 for (String resourceName : helixAdmin.getResourcesInCluster(_helixClusterName)) {
  // Only monitor table resources
  if (!TableNameBuilder.isTableResource(resourceName)) {
   continue;
  }
  // Only monitor enabled resources
  IdealState idealState = helixAdmin.getResourceIdealState(_helixClusterName, resourceName);
  if (idealState.isEnabled()) {
   for (String partitionName : idealState.getPartitionSet()) {
    if (idealState.getInstanceSet(partitionName).contains(_instanceId)) {
     resourcesToMonitor.add(resourceName);
     break;
    }
   }
  }
 }
 return resourcesToMonitor;
}
origin: apache/incubator-pinot

public IdealStateMatchServiceStatusCallback(HelixManager helixManager, String clusterName, String instanceName) {
 _clusterName = clusterName;
 _instanceName = instanceName;
 _helixAdmin = helixManager.getClusterManagmentTool();
 _helixDataAccessor = helixManager.getHelixDataAccessor();
 _resourcesToMonitor = new HashSet<>();
 for (String resourceName : _helixAdmin.getResourcesInCluster(_clusterName)) {
  // Only monitor table resources and broker resource
  if (!TableNameBuilder.isTableResource(resourceName) && !resourceName
    .equals(CommonConstants.Helix.BROKER_RESOURCE_INSTANCE)) {
   continue;
  }
  // Only monitor enabled resources
  IdealState idealState = getResourceIdealState(resourceName);
  if (idealState.isEnabled()) {
   for (String partitionName : idealState.getPartitionSet()) {
    if (idealState.getInstanceSet(partitionName).contains(_instanceName)) {
     _resourcesToMonitor.add(resourceName);
     break;
    }
   }
  }
 }
 _numTotalResourcesToMonitor = _resourcesToMonitor.size();
 LOGGER.info("Monitoring {} resources: {} for start up of instance {}", _numTotalResourcesToMonitor,
   _resourcesToMonitor, _instanceName);
}
origin: apache/incubator-pinot

public static void waitForExternalViewUpdate(String zkAddress, final String clusterName, long timeoutInMilliseconds) {
 final ZKHelixAdmin helixAdmin = new ZKHelixAdmin(zkAddress);
 List<String> allResourcesInCluster = helixAdmin.getResourcesInCluster(clusterName);
 Set<String> tableAndBrokerResources = new HashSet<>();
 for (String resourceName : allResourcesInCluster) {
  // Only check table resources and broker resource
  if (TableNameBuilder.isTableResource(resourceName) || resourceName
    .equals(CommonConstants.Helix.BROKER_RESOURCE_INSTANCE)) {
   tableAndBrokerResources.add(resourceName);
  }
 }
 StrictMatchExternalViewVerifier verifier =
   new StrictMatchExternalViewVerifier.Builder(clusterName).setZkAddr(zkAddress)
     .setResources(tableAndBrokerResources).build();
 boolean success = verifier.verify(timeoutInMilliseconds);
 if (success) {
  LOGGER.info("Cluster is ready to serve queries");
 }
}
origin: apache/incubator-pinot

if (!TableNameBuilder.isTableResource(tableName)) {
 continue;
origin: apache/incubator-pinot

public boolean isServerTenantDeletable(String tenantName) {
 Set<String> taggedInstances = new HashSet<>(
   HelixHelper.getInstancesWithTag(_helixZkManager, TagNameUtils.getOfflineTagForTenant(tenantName)));
 taggedInstances
   .addAll(HelixHelper.getInstancesWithTag(_helixZkManager, TagNameUtils.getRealtimeTagForTenant(tenantName)));
 for (String resourceName : getAllResources()) {
  if (!TableNameBuilder.isTableResource(resourceName)) {
   continue;
  }
  IdealState tableIdealState = _helixAdmin.getResourceIdealState(_helixClusterName, resourceName);
  for (String partition : tableIdealState.getPartitionSet()) {
   for (String instance : tableIdealState.getInstanceSet(partition)) {
    if (taggedInstances.contains(instance)) {
     return false;
    }
   }
  }
 }
 return true;
}
origin: apache/incubator-pinot

if (!TableNameBuilder.isTableResource(tableNameWithType)) {
 continue;
origin: apache/incubator-pinot

if (!TableNameBuilder.isTableResource(table)) {
 continue;
org.apache.pinot.common.configTableNameBuilderisTableResource

Javadoc

Return whether the given resource name represents a table resource.

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.
  • tableNameWithType
    Get the table name with type suffix.
  • forType
    Get the table name builder for the given table type.
  • tableHasTypeSuffix
    Return Whether the table has type suffix that matches the builder type.

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Runner (org.openjdk.jmh.runner)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for WebStorm
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