Package org.apache.solr.search.stats
Class StatsUtil
- java.lang.Object
-
- org.apache.solr.search.stats.StatsUtil
-
public class StatsUtil extends Object
Various utilities for de/serialization of term stats and collection stats.TODO: serialization format is very simple and does nothing to compress the data.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENTRY_SEPARATOR
static char
ENTRY_SEPARATOR_CHAR
static char
ESCAPE
static char
ESCAPE_ENTRY_SEPARATOR
-
Constructor Summary
Constructors Constructor Description StatsUtil()
-
Method Summary
-
-
-
Field Detail
-
ENTRY_SEPARATOR
public static final String ENTRY_SEPARATOR
- See Also:
- Constant Field Values
-
ENTRY_SEPARATOR_CHAR
public static final char ENTRY_SEPARATOR_CHAR
- See Also:
- Constant Field Values
-
ESCAPE
public static final char ESCAPE
- See Also:
- Constant Field Values
-
ESCAPE_ENTRY_SEPARATOR
public static final char ESCAPE_ENTRY_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
shardUrlToShard
public static String shardUrlToShard(String collectionName, String shardUrls)
Parse a list of urls separated by "|" in order to retrieve a shard name.- Parameters:
collectionName
- collection nameshardUrls
- list of urls- Returns:
- shard name, or shardUrl if no shard info is present, or null if impossible to determine (eg. empty string)
-
termsToEncodedString
public static String termsToEncodedString(Collection<?> terms)
-
termsFromEncodedString
public static Set<org.apache.lucene.index.Term> termsFromEncodedString(String data)
-
fieldsToString
public static String fieldsToString(Collection<String> fields)
-
colStatsToString
public static String colStatsToString(CollectionStats colStats)
Make a String representation ofCollectionStats
-
termToEncodedString
public static String termToEncodedString(org.apache.lucene.index.Term t)
-
decode
public static String decode(String value) throws IOException
- Throws:
IOException
-
termFromEncodedString
public static org.apache.lucene.index.Term termFromEncodedString(String data)
-
colStatsMapFromString
public static Map<String,CollectionStats> colStatsMapFromString(String data)
-
colStatsMapToString
public static String colStatsMapToString(Map<String,CollectionStats> stats)
-
-