Tabnine Logo
org.apache.druid.segment.loading
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.druid.segment.loading

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

origin: apache/incubator-druid

@Override
public void kill(DataSegment segment) throws SegmentLoadingException
{
 getKiller(segment).kill(segment);
}
origin: apache/incubator-druid

@Override
public DataSegment move(DataSegment segment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException
{
 return getMover(segment).move(segment, targetLoadSpec);
}
origin: apache/incubator-druid

@Override
public DataSegment archive(DataSegment segment) throws SegmentLoadingException
{
 return getArchiver(segment).archive(segment);
}
origin: apache/incubator-druid

 public SegmentLoader manufacturate(File storageDir)
 {
  return loader.withConfig(
    new SegmentLoaderConfig().withLocations(Collections.singletonList(new StorageLocationConfig().setPath(storageDir)))
  );
 }
}
origin: apache/incubator-druid

private Segment getAdapter(final DataSegment segment) throws SegmentLoadingException
{
 final Segment adapter;
 try {
  adapter = segmentLoader.getSegment(segment);
 }
 catch (SegmentLoadingException e) {
  segmentLoader.cleanup(segment);
  throw e;
 }
 if (adapter == null) {
  throw new SegmentLoadingException("Null adapter from loadSpec[%s]", segment.getLoadSpec());
 }
 return adapter;
}
origin: apache/incubator-druid

@Override
public File getSegmentFiles(DataSegment segment) throws SegmentLoadingException
{
 StorageLocation loc = findStorageLocationIfLoaded(segment);
 String storageDir = DataSegmentPusher.getDefaultStorageDir(segment, false);
 if (loc == null) {
  loc = loadSegmentWithRetry(segment, storageDir);
 }
 loc.addSegment(segment);
 return new File(loc.getPath(), storageDir);
}
origin: apache/incubator-druid

 @Override
 public LoadSpecResult loadSegment(final File outDir) throws SegmentLoadingException
 {
  return new LoadSpecResult(puller.getSegmentFiles(path.toFile(), outDir).size());
 }
}
origin: apache/incubator-druid

private StorageLocation findStorageLocationIfLoaded(final DataSegment segment)
{
 for (StorageLocation location : getSortedList(locations)) {
  File localStorageDir = new File(location.getPath(), DataSegmentPusher.getDefaultStorageDir(segment, false));
  if (localStorageDir.exists()) {
   return location;
  }
 }
 return null;
}
origin: apache/incubator-druid

private void verifyLoc(long maxSize, StorageLocation loc)
{
 Assert.assertEquals(maxSize, loc.available());
 for (int i = 0; i <= maxSize; ++i) {
  Assert.assertTrue(String.valueOf(i), loc.canHandle(makeSegment("2013/2014", i)));
 }
}
origin: apache/incubator-druid

default String getStorageDir(DataSegment dataSegment, boolean useUniquePath)
{
 return getDefaultStorageDir(dataSegment, useUniquePath);
}
origin: apache/incubator-druid

public SegmentLoaderConfig withLocations(List<StorageLocationConfig> locations)
{
 SegmentLoaderConfig retVal = new SegmentLoaderConfig();
 retVal.locations = Lists.newArrayList(locations);
 retVal.deleteOnRemove = this.deleteOnRemove;
 retVal.infoDir = this.infoDir;
 return retVal;
}
origin: apache/incubator-druid

@Override
public DataSegment restore(DataSegment segment) throws SegmentLoadingException
{
 return getArchiver(segment).restore(segment);
}
origin: apache/incubator-druid

public SegmentLoaderLocalCacheManager withConfig(SegmentLoaderConfig config)
{
 return new SegmentLoaderLocalCacheManager(indexIO, config, jsonMapper);
}
origin: apache/incubator-druid

 @Override
 public DataSegment push(final File dataSegmentFile, final DataSegment segment, final boolean useUniquePath)
   throws IOException
 {
  final DataSegment returnSegment = super.push(dataSegmentFile, segment, useUniquePath);
  segments.add(returnSegment);
  return returnSegment;
 }
};
origin: apache/incubator-druid

/**
 * @deprecated backward-compatibiliy shim that should be removed on next major release;
 * use {@link #getStorageDir(DataSegment, boolean)} instead.
 */
@Deprecated
default String getStorageDir(DataSegment dataSegment)
{
 return getStorageDir(dataSegment, false);
}
origin: apache/incubator-druid

@Override
public boolean isSegmentLoaded(final DataSegment segment)
{
 return findStorageLocationIfLoaded(segment) != null;
}
origin: apache/incubator-druid

public boolean isSegmentCached(final DataSegment segment)
{
 return segmentLoader.isSegmentLoaded(segment);
}
origin: apache/incubator-druid

@Override
public InputStream getInputStream(URI uri) throws IOException
{
 return buildFileObject(uri).openInputStream();
}
origin: apache/incubator-druid

 @Override
 public DataSegment push(File file, DataSegment segment, boolean useUniquePath) throws IOException
 {
  segments.add(segment);
  return super.push(file, segment, useUniquePath);
 }
};
origin: apache/incubator-druid

default String makeIndexPathName(DataSegment dataSegment, String indexName)
{
 // This is only called from Hadoop batch which doesn't require unique segment paths so set useUniquePath=false
 return StringUtils.format("./%s/%s", getStorageDir(dataSegment, false), indexName);
}
org.apache.druid.segment.loading

Most used classes

  • DataSegmentPusher
  • SegmentLoadingException
  • LoadSpec$LoadSpecResult
  • DataSegmentKiller
  • DataSegmentFinder
    A DataSegmentFinder is responsible for finding Druid segments underneath a specified directory and o
  • SegmentLoaderConfig,
  • SegmentLoaderLocalCacheManager,
  • StorageLocationConfig,
  • LocalDataSegmentKiller,
  • LocalDataSegmentPuller,
  • LocalDataSegmentPusher,
  • LocalDataSegmentPusherConfig,
  • MMappedQueryableSegmentizerFactory,
  • NoopDataSegmentPusher,
  • DataSegmentArchiver,
  • DataSegmentMover,
  • LocalDataSegmentFinder,
  • LocalFileTimestampVersionFinder,
  • StorageLocation
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