DataSegment.getLoadSpec
Code IndexAdd Codota to your IDE (free)

Best code snippets using io.druid.timeline.DataSegment.getLoadSpec(Showing top 15 results out of 315)

origin: druid-io/druid

@Override
public void getSegmentFiles(DataSegment segment, File outDir) throws SegmentLoadingException
{
 final Map<String, Object> loadSpec = segment.getLoadSpec();
 final String containerName = MapUtils.getString(loadSpec, "containerName");
 final String blobPath = MapUtils.getString(loadSpec, "blobPath");
 getSegmentFiles(containerName, blobPath, outDir);
}
origin: druid-io/druid

 private Path getPath(DataSegment segment)
 {
  return new Path(String.valueOf(segment.getLoadSpec().get("path")));
 }
}
origin: druid-io/druid

@Override
public void getSegmentFiles(final DataSegment segment, final File outDir) throws SegmentLoadingException
{
 final Map<String, Object> loadSpec = segment.getLoadSpec();
 final String region = MapUtils.getString(loadSpec, "region");
 final String container = MapUtils.getString(loadSpec, "container");
 final String path = MapUtils.getString(loadSpec, "path");
 log.info("Pulling index at path[%s] to outDir[%s]", path, outDir);
 prepareOutDir(outDir);
 getSegmentFiles(region, container, path, outDir);
}
origin: druid-io/druid

 private File getPath(DataSegment segment) throws SegmentLoadingException
 {
  return new File(MapUtils.getString(segment.getLoadSpec(), PATH_KEY));
 }
}
origin: druid-io/druid

 boolean sameLoadSpec(DataSegment s1, DataSegment s2)
 {
  final S3LoadSpec s1LoadSpec = (S3LoadSpec) mapper.convertValue(s1.getLoadSpec(), LoadSpec.class);
  final S3LoadSpec s2LoadSpec = (S3LoadSpec) mapper.convertValue(s2.getLoadSpec(), LoadSpec.class);
  return Objects.equal(s1LoadSpec.getBucket(), s2LoadSpec.getBucket()) && Objects.equal(
    s1LoadSpec.getKey(),
    s2LoadSpec.getKey()
  );
 }
}
origin: druid-io/druid

private DataSegmentKiller getKiller(DataSegment segment) throws SegmentLoadingException
{
 String type = MapUtils.getString(segment.getLoadSpec(), "type");
 DataSegmentKiller loader = killers.get(type);
 if (loader == null) {
  throw new SegmentLoadingException("Unknown loader type[%s].  Known types are %s", type, killers.keySet());
 }
 return loader;
}
origin: druid-io/druid

@Override
public void getSegmentFiles(DataSegment segment, File outDir) throws SegmentLoadingException
{
 String key = (String) segment.getLoadSpec().get("key");
 getSegmentFiles(key, outDir);
}
public FileUtils.FileCopyResult getSegmentFiles(final String key, final File outDir)
origin: druid-io/druid

 private File getFile(DataSegment segment) throws SegmentLoadingException
 {
  final Map<String, Object> loadSpec = segment.getLoadSpec();
  final File path = new File(MapUtils.getString(loadSpec, "path"));

  if (!path.exists()) {
   throw new SegmentLoadingException("Asked to load path[%s], but it doesn't exist.", path);
  }

  return path;
 }
}
origin: druid-io/druid

 private DataSegmentArchiver getArchiver(DataSegment segment) throws SegmentLoadingException
 {
  String type = MapUtils.getString(segment.getLoadSpec(), "type");
  DataSegmentArchiver archiver = archivers.get(type);

  if (archiver == null) {
   throw new SegmentLoadingException("Unknown loader type[%s].  Known types are %s", type, archivers.keySet());
  }

  return archiver;
 }
}
origin: druid-io/druid

@Override
public boolean isSegmentLoaded(DataSegment segment) throws SegmentLoadingException
{
 Map<String, Object> loadSpec = segment.getLoadSpec();
 return new File(MapUtils.getString(loadSpec, "cacheDir")).exists();
}
origin: druid-io/druid

@Override
public Segment getSegment(final DataSegment segment)
{
 return new SegmentForTesting(
   MapUtils.getString(segment.getLoadSpec(), "version"),
   (Interval) segment.getLoadSpec().get("interval")
 );
}
origin: druid-io/druid

public S3Coords(DataSegment segment)
{
 Map<String, Object> loadSpec = segment.getLoadSpec();
 bucket = MapUtils.getString(loadSpec, BUCKET);
 path = MapUtils.getString(loadSpec, KEY);
 if (path.startsWith("/")) {
  path = path.substring(1);
 }
}
origin: druid-io/druid

@Override
public Segment getSegment(final DataSegment segment) throws SegmentLoadingException
{
 return new SegmentForTesting(
   MapUtils.getString(segment.getLoadSpec(), "version"),
   (Interval) segment.getLoadSpec().get("interval")
 );
}
origin: druid-io/druid

@Override
public void getSegmentFiles(final DataSegment segment, final File outDir) throws SegmentLoadingException
{
 final Map<String, Object> loadSpec = segment.getLoadSpec();
 final String bucket = MapUtils.getString(loadSpec, "bucket");
 final String path = MapUtils.getString(loadSpec, "path");
 getSegmentFiles(bucket, path, outDir);
}
origin: druid-io/druid

 private DataSegmentMover getMover(DataSegment segment) throws SegmentLoadingException
 {
  String type = MapUtils.getString(segment.getLoadSpec(), "type");
  DataSegmentMover mover = movers.get(type);

  if (mover == null) {
   throw new SegmentLoadingException("Unknown loader type[%s].  Known types are %s", type, movers.keySet());
  }

  return mover;
 }
}
io.druid.timelineDataSegmentgetLoadSpec

Popular methods of DataSegment

  • getIdentifier
  • getDataSource
    Get dataSource
  • getVersion
  • getInterval
  • getShardSpec
  • withBinaryVersion
  • withLoadSpec
  • builder
  • getDimensions
  • withSize
  • <init>
  • getMetrics
  • <init>,
  • getMetrics,
  • getSize,
  • compareTo,
  • getBinaryVersion,
  • makeDataSegmentIdentifier,
  • withVersion,
  • equals,
  • hashCode

Popular classes and methods

  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Menu (java.awt)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • SortedMap (java.util)
    A Map that further provides a total ordering on its keys. The map is ordered according to the Compar
  • Pattern (java.util.regex)
    Emulation of the Pattern class, uses RegExp as internal implementation.
  • Reference (javax.naming)
  • JComboBox (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)