forked from apache/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#841 from metamx/distinguish-legacy-vs-defau…
…lt-bitmap Distinguish between default and legacy bitmaps
- Loading branch information
Showing
4 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
processing/src/main/java/io/druid/segment/data/BitmapSerde.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Druid - a distributed column store. | ||
* Copyright (C) 2014 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.segment.data; | ||
|
||
import com.metamx.common.ISE; | ||
|
||
public class BitmapSerde | ||
{ | ||
// default bitmap indices in Druid <= 0.6.x | ||
public static final Class<ConciseBitmapSerdeFactory> LEGACY_BITMAP_FACTORY = ConciseBitmapSerdeFactory.class; | ||
|
||
// default bitmap indices for Druid >= 0.7.x | ||
public static final Class<ConciseBitmapSerdeFactory> DEFAULT_BITMAP_FACTORY = ConciseBitmapSerdeFactory.class; | ||
|
||
public static BitmapSerdeFactory createDefaultFactory() | ||
{ | ||
try { | ||
return DEFAULT_BITMAP_FACTORY.newInstance(); | ||
} catch(InstantiationException | IllegalAccessException e) { | ||
// should never happen | ||
throw new ISE(e, "Unable to instatiate BitmapSerdeFactory"); | ||
} | ||
} | ||
public static BitmapSerdeFactory createLegacyFactory() | ||
{ | ||
try { | ||
return LEGACY_BITMAP_FACTORY.newInstance(); | ||
} catch(InstantiationException | IllegalAccessException e) { | ||
// should never happen | ||
throw new ISE(e, "Unable to instatiate BitmapSerdeFactory"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters