From b5d66381f38fc5a14c20d89afa4a4b4c675a852a Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Tue, 14 Oct 2014 18:32:40 +0530 Subject: [PATCH] more cleanup --- .../cassandra/CassandraDataSegmentPuller.java | 20 -------- .../storage/hdfs/HdfsDataSegmentPuller.java | 14 ------ .../io/druid/indexer/IndexGeneratorJob.java | 1 - .../druid/indexer/rollup/DataRollupSpec.java | 46 ------------------- .../overlord/http/OverlordResource.java | 21 --------- .../druid/storage/s3/S3DataSegmentPuller.java | 25 ---------- .../granularity/ArbitraryGranularitySpec.java | 9 ---- .../indexing/granularity/GranularitySpec.java | 2 - .../granularity/UniformGranularitySpec.java | 10 ---- .../loading/LocalDataSegmentPuller.java | 18 -------- 10 files changed, 166 deletions(-) delete mode 100644 indexing-hadoop/src/main/java/io/druid/indexer/rollup/DataRollupSpec.java diff --git a/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPuller.java b/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPuller.java index 0296d1045a9..bad0a459784 100644 --- a/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPuller.java +++ b/cassandra-storage/src/main/java/io/druid/storage/cassandra/CassandraDataSegmentPuller.java @@ -97,24 +97,4 @@ public class CassandraDataSegmentPuller extends CassandraStorage implements Data log.info("Pull of file[%s] completed in %,d millis (%s bytes)", key, System.currentTimeMillis() - startTime, meta.getObjectSize()); } - - @Override - public long getLastModified(DataSegment segment) throws SegmentLoadingException - { - String key = (String) segment.getLoadSpec().get("key"); - OperationResult> result; - try - { - result = this.keyspace.prepareQuery(descriptorStorage) - .getKey(key) - .execute(); - ColumnList children = result.getResult(); - long lastModified = children.getColumnByName("lastmodified").getLongValue(); - log.info("Read lastModified for [%s] as [%d]", key, lastModified); - return lastModified; - } catch (ConnectionException e) - { - throw new SegmentLoadingException(e, e.getMessage()); - } - } } diff --git a/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPuller.java b/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPuller.java index f560d79f7aa..eae739ab110 100644 --- a/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPuller.java +++ b/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPuller.java @@ -65,20 +65,6 @@ public class HdfsDataSegmentPuller implements DataSegmentPuller } } - @Override - public long getLastModified(DataSegment segment) throws SegmentLoadingException - { - Path path = getPath(segment); - FileSystem fs = checkPathAndGetFilesystem(path); - - try { - return fs.getFileStatus(path).getModificationTime(); - } - catch (IOException e) { - throw new SegmentLoadingException(e, "Problem loading status of path[%s]", path); - } - } - private Path getPath(DataSegment segment) { return new Path(String.valueOf(segment.getLoadSpec().get("path"))); diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java index df3bdcaecce..02ad8ccf89c 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/IndexGeneratorJob.java @@ -322,7 +322,6 @@ public class IndexGeneratorJob implements Jobby Bucket bucket = Bucket.fromGroupKey(keyBytes.getGroupKey()).lhs; final Interval interval = config.getGranularitySpec().bucketInterval(bucket.time).get(); - //final DataRollupSpec rollupSpec = config.getRollupSpec(); final AggregatorFactory[] aggs = config.getSchema().getDataSchema().getAggregators(); IncrementalIndex index = makeIncrementalIndex(bucket, aggs); diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/rollup/DataRollupSpec.java b/indexing-hadoop/src/main/java/io/druid/indexer/rollup/DataRollupSpec.java deleted file mode 100644 index 9f5048559d1..00000000000 --- a/indexing-hadoop/src/main/java/io/druid/indexer/rollup/DataRollupSpec.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012, 2013 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package io.druid.indexer.rollup; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.druid.granularity.QueryGranularity; -import io.druid.query.aggregation.AggregatorFactory; - -import java.util.List; - -/** - * Class uses public fields to work around http://jira.codehaus.org/browse/MSHADE-92 - * - * Adjust to JsonCreator and final fields when resolved. - */ -@Deprecated -public class DataRollupSpec -{ - @JsonProperty - public List aggs; - - @JsonProperty - public QueryGranularity rollupGranularity = QueryGranularity.NONE; - - public List getAggs() - { - return aggs; - } -} diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java index 248d6611b48..e59f021888c 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java @@ -93,27 +93,6 @@ public class OverlordResource this.configManager = configManager; } - @POST - @Path("/merge") - @Consumes("application/json") - @Produces("application/json") - @Deprecated - public Response doMerge(final Task task) - { - // legacy endpoint - return doIndex(task); - } - - @POST - @Path("/index") - @Consumes("application/json") - @Produces("application/json") - @Deprecated - public Response doIndex(final Task task) - { - return taskPost(task); - } - @POST @Path("/task") @Consumes("application/json") diff --git a/s3-extensions/src/main/java/io/druid/storage/s3/S3DataSegmentPuller.java b/s3-extensions/src/main/java/io/druid/storage/s3/S3DataSegmentPuller.java index f9b68a05440..53ed2f01d34 100644 --- a/s3-extensions/src/main/java/io/druid/storage/s3/S3DataSegmentPuller.java +++ b/s3-extensions/src/main/java/io/druid/storage/s3/S3DataSegmentPuller.java @@ -168,31 +168,6 @@ public class S3DataSegmentPuller implements DataSegmentPuller } } - @Override - public long getLastModified(DataSegment segment) throws SegmentLoadingException - { - final S3Coords coords = new S3Coords(segment); - try { - final S3Object objDetails = S3Utils.retryS3Operation( - new Callable() - { - @Override - public S3Object call() throws Exception - { - return s3Client.getObjectDetails(new S3Bucket(coords.bucket), coords.path); - } - } - ); - return objDetails.getLastModifiedDate().getTime(); - } - catch (S3ServiceException | IOException e) { - throw new SegmentLoadingException(e, e.getMessage()); - } - catch (Exception e) { - throw Throwables.propagate(e); - } - } - private static class S3Coords { String bucket; diff --git a/server/src/main/java/io/druid/segment/indexing/granularity/ArbitraryGranularitySpec.java b/server/src/main/java/io/druid/segment/indexing/granularity/ArbitraryGranularitySpec.java index 807764e515c..12342142928 100644 --- a/server/src/main/java/io/druid/segment/indexing/granularity/ArbitraryGranularitySpec.java +++ b/server/src/main/java/io/druid/segment/indexing/granularity/ArbitraryGranularitySpec.java @@ -107,13 +107,4 @@ public class ArbitraryGranularitySpec implements GranularitySpec { return queryGranularity; } - - @Override - public GranularitySpec withQueryGranularity(QueryGranularity queryGranularity) - { - return new ArbitraryGranularitySpec( - queryGranularity, - Lists.newArrayList(intervals) - ); - } } diff --git a/server/src/main/java/io/druid/segment/indexing/granularity/GranularitySpec.java b/server/src/main/java/io/druid/segment/indexing/granularity/GranularitySpec.java index 263d820e8b4..730077e8c44 100644 --- a/server/src/main/java/io/druid/segment/indexing/granularity/GranularitySpec.java +++ b/server/src/main/java/io/druid/segment/indexing/granularity/GranularitySpec.java @@ -59,6 +59,4 @@ public interface GranularitySpec public QueryGranularity getQueryGranularity(); - @Deprecated - public GranularitySpec withQueryGranularity(QueryGranularity queryGranularity); } diff --git a/server/src/main/java/io/druid/segment/indexing/granularity/UniformGranularitySpec.java b/server/src/main/java/io/druid/segment/indexing/granularity/UniformGranularitySpec.java index 9bf64ff8dd4..a9c6911dbe9 100644 --- a/server/src/main/java/io/druid/segment/indexing/granularity/UniformGranularitySpec.java +++ b/server/src/main/java/io/druid/segment/indexing/granularity/UniformGranularitySpec.java @@ -101,16 +101,6 @@ public class UniformGranularitySpec implements GranularitySpec return queryGranularity; } - @Override - public GranularitySpec withQueryGranularity(QueryGranularity queryGranularity) - { - return new UniformGranularitySpec( - segmentGranularity, - queryGranularity, - inputIntervals - ); - } - @JsonProperty("intervals") public Optional> getIntervals() { diff --git a/server/src/main/java/io/druid/segment/loading/LocalDataSegmentPuller.java b/server/src/main/java/io/druid/segment/loading/LocalDataSegmentPuller.java index 831c77d79cd..b32b3806954 100644 --- a/server/src/main/java/io/druid/segment/loading/LocalDataSegmentPuller.java +++ b/server/src/main/java/io/druid/segment/loading/LocalDataSegmentPuller.java @@ -73,24 +73,6 @@ public class LocalDataSegmentPuller implements DataSegmentPuller } } - @Override - public long getLastModified(DataSegment segment) throws SegmentLoadingException - { - final File file = getFile(segment); - - long lastModified = Long.MAX_VALUE; - if (file.isDirectory()) { - for (File childFile : file.listFiles()) { - lastModified = Math.min(childFile.lastModified(), lastModified); - } - } - else { - lastModified = file.lastModified(); - } - - return lastModified; - } - private File getFile(DataSegment segment) throws SegmentLoadingException { final Map loadSpec = segment.getLoadSpec();