Tabnine Logo
Segment
Code IndexAdd Tabnine to your IDE (free)

How to use
Segment
in
org.apache.druid.segment

Best Java code snippets using org.apache.druid.segment.Segment (Showing top 20 results out of 315)

origin: apache/incubator-druid

@Override
public Interval getDataInterval()
{
 return !isClosed() ? baseSegment.getDataInterval() : null;
}
origin: apache/incubator-druid

@Override
public QueryableIndex asQueryableIndex()
{
 return !isClosed() ? baseSegment.asQueryableIndex() : null;
}
origin: apache/incubator-druid

 @Override
 protected boolean onAdvance(int phase, int registeredParties)
 {
  Preconditions.checkState(registeredParties == 0);
  // Ensure that onAdvance() doesn't throw exception, otherwise termination won't happen
  try {
   baseSegment.close();
  }
  catch (Exception e) {
   try {
    log.error(e, "Exception while closing segment[%s]", baseSegment.getId());
   }
   catch (Exception e2) {
    // ignore
   }
  }
  // Always terminate.
  return true;
 }
};
origin: apache/incubator-druid

final QueryableIndex index = segment.asQueryableIndex();
final StorageAdapter adapter = segment.asStorageAdapter();
final List<DimensionSpec> searchDims = getDimsToSearch(adapter.getAvailableDimensions(), query.getDimensions());
origin: apache/incubator-druid

               Collections.singletonList(segment.getDataInterval()) : null;
 metadata = segment.asStorageAdapter().getMetadata();
 if (metadata != null && metadata.getAggregators() != null) {
  aggregators = new HashMap<>();
if (updatedQuery.hasTimestampSpec()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
if (updatedQuery.hasQueryGranularity()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
if (updatedQuery.hasRollup()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
  Collections.singletonList(
    new SegmentAnalysis(
      segment.getId().toString(),
      retIntervals,
      columns,
origin: org.apache.druid/druid-processing

               Collections.singletonList(segment.getDataInterval()) : null;
 metadata = segment.asStorageAdapter().getMetadata();
 if (metadata != null && metadata.getAggregators() != null) {
  aggregators = Maps.newHashMap();
if (updatedQuery.hasTimestampSpec()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
if (updatedQuery.hasQueryGranularity()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
if (updatedQuery.hasRollup()) {
 if (metadata == null) {
  metadata = segment.asStorageAdapter().getMetadata();
  Collections.singletonList(
    new SegmentAnalysis(
      segment.getIdentifier(),
      retIntervals,
      columns,
origin: apache/incubator-druid

public GroupByQueryRunner(Segment segment, final GroupByStrategySelector strategySelector)
{
 this.adapter = segment.asStorageAdapter();
 this.strategySelector = strategySelector;
}
origin: apache/incubator-druid

final long timeoutAt = (long) responseContext.get(ScanQueryRunnerFactory.CTX_TIMEOUT_AT);
final long start = System.currentTimeMillis();
final StorageAdapter adapter = segment.asStorageAdapter();
Preconditions.checkArgument(intervals.size() == 1, "Can only handle a single interval, got[%s]", intervals);
final SegmentId segmentId = segment.getId();
origin: org.apache.druid/druid-processing

final long timeoutAt = (long) responseContext.get(ScanQueryRunnerFactory.CTX_TIMEOUT_AT);
final long start = System.currentTimeMillis();
final StorageAdapter adapter = segment.asStorageAdapter();
Preconditions.checkArgument(intervals.size() == 1, "Can only handle a single interval, got[%s]", intervals);
final String segmentId = segment.getIdentifier();
origin: org.apache.druid/druid-processing

 @Override
 protected boolean onAdvance(int phase, int registeredParties)
 {
  Preconditions.checkState(registeredParties == 0);
  // Ensure that onAdvance() doesn't throw exception, otherwise termination won't happen
  try {
   baseSegment.close();
  }
  catch (Exception e) {
   try {
    log.error(e, "Exception while closing segment[%s]", baseSegment.getIdentifier());
   }
   catch (Exception e2) {
    // ignore
   }
  }
  // Always terminate.
  return true;
 }
};
origin: apache/incubator-druid

@Override
public SegmentId getId()
{
 return !isClosed() ? baseSegment.getId() : null;
}
origin: org.apache.druid/druid-processing

@Override
public String getIdentifier()
{
 return !isClosed() ? baseSegment.getIdentifier() : null;
}
origin: apache/incubator-druid

 @Override
 public <T> T as(Class<T> clazz)
 {
  return getBaseSegment().as(clazz);
 }
}
origin: apache/incubator-druid

final QueryableIndex index = segment.asQueryableIndex();
final StorageAdapter storageAdapter = segment.asStorageAdapter();
origin: apache/incubator-druid

public DataSourceMetadataQueryRunner(Segment segment)
{
 this.adapter = segment.asStorageAdapter();
}
origin: apache/incubator-druid

public Sequence<Result<SelectResultValue>> process(final SelectQuery query, final Segment segment)
 final StorageAdapter adapter = segment.asStorageAdapter();
 final String segmentId = segment.getId().withInterval(intervals.get(0)).toString();
origin: org.apache.druid/druid-processing

public Sequence<Result<SelectResultValue>> process(final SelectQuery query, final Segment segment)
 final StorageAdapter adapter = segment.asStorageAdapter();
 final String segmentId = DataSegmentUtils.withInterval(dataSource, segment.getIdentifier(), intervals.get(0));
origin: apache/incubator-druid

public void swapSegment(@Nullable Segment newSegment)
{
 while (true) {
  ReferenceCountingSegment currentSegment = adapter.get();
  if (currentSegment == null && newSegment == null) {
   return;
  }
  if (currentSegment != null && newSegment != null &&
    !newSegment.getId().equals(currentSegment.getId())) {
   // Sanity check: identifier should not change
   throw new ISE(
     "WTF?! Cannot swap identifier[%s] -> [%s]!",
     currentSegment.getId(),
     newSegment.getId()
   );
  }
  if (currentSegment == newSegment) {
   throw new ISE("Cannot swap to the same segment");
  }
  ReferenceCountingSegment newReferenceCountingSegment =
    newSegment != null ? new ReferenceCountingSegment(newSegment) : null;
  if (adapter.compareAndSet(currentSegment, newReferenceCountingSegment)) {
   if (currentSegment != null) {
    currentSegment.close();
   }
   index = null;
   return;
  }
 }
}
origin: org.apache.druid/druid-server

public void swapSegment(@Nullable Segment newSegment)
{
 while (true) {
  ReferenceCountingSegment currentSegment = adapter.get();
  if (currentSegment == null && newSegment == null) {
   return;
  }
  if (currentSegment != null && newSegment != null &&
    !newSegment.getIdentifier().equals(currentSegment.getIdentifier())) {
   // Sanity check: identifier should not change
   throw new ISE(
     "WTF?! Cannot swap identifier[%s] -> [%s]!",
     currentSegment.getIdentifier(),
     newSegment.getIdentifier()
   );
  }
  if (currentSegment == newSegment) {
   throw new ISE("Cannot swap to the same segment");
  }
  ReferenceCountingSegment newReferenceCountingSegment =
    newSegment != null ? new ReferenceCountingSegment(newSegment) : null;
  if (adapter.compareAndSet(currentSegment, newReferenceCountingSegment)) {
   if (currentSegment != null) {
    currentSegment.close();
   }
   index = null;
   return;
  }
 }
}
origin: org.apache.druid/druid-processing

 @Override
 public <T> T as(Class<T> clazz)
 {
  return getBaseSegment().as(clazz);
 }
}
org.apache.druid.segmentSegment

Javadoc

The difference between this class and org.apache.druid.timeline.DataSegment is that org.apache.druid.timeline.DataSegment contains the segment metadata only, while this class represents the actual body of segment data, queryable.

Most used methods

  • getDataInterval
  • asQueryableIndex
  • getId
  • getIdentifier
  • as
    Request an implementation of a particular interface. If the passed-in interface is QueryableIndex or
  • asStorageAdapter
  • close

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top plugins for Android Studio
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