You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/03/12 15:39:39 UTC
svn commit: r1576755 [21/27] - in /lucene/dev/trunk: lucene/
lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/
lucene/analysis/common/src/java/org/apache/lucene/a...
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java Wed Mar 12 14:39:17 2014
@@ -53,7 +53,7 @@ public class CommandHandler {
public static class Builder {
private SolrIndexSearcher.QueryCommand queryCommand;
- private List<Command> commands = new ArrayList<Command>();
+ private List<Command> commands = new ArrayList<>();
private SolrIndexSearcher searcher;
private boolean needDocSet = false;
private boolean truncateGroups = false;
@@ -137,7 +137,7 @@ public class CommandHandler {
@SuppressWarnings("unchecked")
public void execute() throws IOException {
final int nrOfCommands = commands.size();
- List<Collector> collectors = new ArrayList<Collector>(nrOfCommands);
+ List<Collector> collectors = new ArrayList<>(nrOfCommands);
for (Command command : commands) {
collectors.addAll(command.create());
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java Wed Mar 12 14:39:17 2014
@@ -88,7 +88,7 @@ public class SearchGroupsFieldCommand im
@Override
public List<Collector> create() throws IOException {
- List<Collector> collectors = new ArrayList<Collector>();
+ List<Collector> collectors = new ArrayList<>();
if (topNGroups > 0) {
firstPassGroupingCollector = new TermFirstPassGroupingCollector(field.getName(), groupSort, topNGroups);
collectors.add(firstPassGroupingCollector);
@@ -114,7 +114,7 @@ public class SearchGroupsFieldCommand im
} else {
groupCount = null;
}
- return new Pair<Integer, Collection<SearchGroup<BytesRef>>>(groupCount, topGroups);
+ return new Pair<>(groupCount, topGroups);
}
@Override
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java Wed Mar 12 14:39:17 2014
@@ -125,7 +125,7 @@ public class TopGroupsFieldCommand imple
return Collections.emptyList();
}
- List<Collector> collectors = new ArrayList<Collector>();
+ List<Collector> collectors = new ArrayList<>();
secondPassCollector = new TermSecondPassGroupingCollector(
field.getName(), firstPhaseGroups, groupSort, sortWithinGroup, maxDocPerGroup, needScores, needMaxScore, true
);
@@ -137,7 +137,7 @@ public class TopGroupsFieldCommand imple
@SuppressWarnings("unchecked")
public TopGroups<BytesRef> result() {
if (firstPhaseGroups.isEmpty()) {
- return new TopGroups<BytesRef>(groupSort.getSort(), sortWithinGroup.getSort(), 0, 0, new GroupDocs[0], Float.NaN);
+ return new TopGroups<>(groupSort.getSort(), sortWithinGroup.getSort(), 0, 0, new GroupDocs[0], Float.NaN);
}
return secondPassCollector.getTopGroups(0);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java Wed Mar 12 14:39:17 2014
@@ -42,7 +42,7 @@ public class StoredFieldsShardRequestFac
@Override
public ShardRequest[] constructRequest(ResponseBuilder rb) {
- HashMap<String, Set<ShardDoc>> shardMap = new HashMap<String,Set<ShardDoc>>();
+ HashMap<String, Set<ShardDoc>> shardMap = new HashMap<>();
for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
for (GroupDocs<BytesRef> group : topGroups.groups) {
mapShardToDocs(shardMap, group.scoreDocs);
@@ -75,7 +75,7 @@ public class StoredFieldsShardRequestFac
}
}
- List<String> ids = new ArrayList<String>(shardDocs.size());
+ List<String> ids = new ArrayList<>(shardDocs.size());
for (ShardDoc shardDoc : shardDocs) {
ids.add(shardDoc.id.toString());
}
@@ -91,7 +91,7 @@ public class StoredFieldsShardRequestFac
ShardDoc solrDoc = (ShardDoc) scoreDoc;
Set<ShardDoc> shardDocs = shardMap.get(solrDoc.shard);
if (shardDocs == null) {
- shardMap.put(solrDoc.shard, shardDocs = new HashSet<ShardDoc>());
+ shardMap.put(solrDoc.shard, shardDocs = new HashSet<>());
}
shardDocs.add(solrDoc);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java Wed Mar 12 14:39:17 2014
@@ -67,7 +67,7 @@ public class TopGroupsShardRequestFactor
private ShardRequest[] createRequestForSpecificShards(ResponseBuilder rb) {
// Determine all unique shards to query for TopGroups
- Set<String> uniqueShards = new HashSet<String>();
+ Set<String> uniqueShards = new HashSet<>();
for (String command : rb.searchGroupToShards.keySet()) {
Map<SearchGroup<BytesRef>, Set<String>> groupsToShard = rb.searchGroupToShards.get(command);
for (Set<String> shards : groupsToShard.values()) {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java Wed Mar 12 14:39:17 2014
@@ -52,8 +52,8 @@ public class SearchGroupShardResponsePro
Sort groupSort = rb.getGroupingSpec().getGroupSort();
String[] fields = rb.getGroupingSpec().getFields();
- Map<String, List<Collection<SearchGroup<BytesRef>>>> commandSearchGroups = new HashMap<String, List<Collection<SearchGroup<BytesRef>>>>();
- Map<String, Map<SearchGroup<BytesRef>, Set<String>>> tempSearchGroupToShards = new HashMap<String, Map<SearchGroup<BytesRef>, Set<String>>>();
+ Map<String, List<Collection<SearchGroup<BytesRef>>>> commandSearchGroups = new HashMap<>();
+ Map<String, Map<SearchGroup<BytesRef>, Set<String>>> tempSearchGroupToShards = new HashMap<>();
for (String field : fields) {
commandSearchGroups.put(field, new ArrayList<Collection<SearchGroup<BytesRef>>>(shardRequest.responses.size()));
tempSearchGroupToShards.put(field, new HashMap<SearchGroup<BytesRef>, Set<String>>());
@@ -69,13 +69,13 @@ public class SearchGroupShardResponsePro
NamedList<Object> shardInfo = null;
if (rb.req.getParams().getBool(ShardParams.SHARDS_INFO, false)) {
- shardInfo = new SimpleOrderedMap<Object>();
+ shardInfo = new SimpleOrderedMap<>();
rb.rsp.getValues().add(ShardParams.SHARDS_INFO + ".firstPhase", shardInfo);
}
for (ShardResponse srsp : shardRequest.responses) {
if (shardInfo != null) {
- SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> nl = new SimpleOrderedMap<>();
if (srsp.getException() != null) {
Throwable t = srsp.getException();
@@ -126,7 +126,7 @@ public class SearchGroupShardResponsePro
Map<SearchGroup<BytesRef>, java.util.Set<String>> map = tempSearchGroupToShards.get(field);
Set<String> shards = map.get(searchGroup);
if (shards == null) {
- shards = new HashSet<String>();
+ shards = new HashSet<>();
map.put(searchGroup, shards);
}
shards.add(srsp.getShard());
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java Wed Mar 12 14:39:17 2014
@@ -70,12 +70,12 @@ public class TopGroupsShardResponseProce
}
int docsPerGroupDefault = rb.getGroupingSpec().getGroupLimit();
- Map<String, List<TopGroups<BytesRef>>> commandTopGroups = new HashMap<String, List<TopGroups<BytesRef>>>();
+ Map<String, List<TopGroups<BytesRef>>> commandTopGroups = new HashMap<>();
for (String field : fields) {
commandTopGroups.put(field, new ArrayList<TopGroups<BytesRef>>());
}
- Map<String, List<QueryCommandResult>> commandTopDocs = new HashMap<String, List<QueryCommandResult>>();
+ Map<String, List<QueryCommandResult>> commandTopDocs = new HashMap<>();
for (String query : queries) {
commandTopDocs.put(query, new ArrayList<QueryCommandResult>());
}
@@ -84,14 +84,14 @@ public class TopGroupsShardResponseProce
NamedList<Object> shardInfo = null;
if (rb.req.getParams().getBool(ShardParams.SHARDS_INFO, false)) {
- shardInfo = new SimpleOrderedMap<Object>();
+ shardInfo = new SimpleOrderedMap<>();
rb.rsp.getValues().add(ShardParams.SHARDS_INFO, shardInfo);
}
for (ShardResponse srsp : shardRequest.responses) {
SimpleOrderedMap<Object> individualShardInfo = null;
if (shardInfo != null) {
- individualShardInfo = new SimpleOrderedMap<Object>();
+ individualShardInfo = new SimpleOrderedMap<>();
if (srsp.getException() != null) {
Throwable t = srsp.getException();
@@ -161,7 +161,7 @@ public class TopGroupsShardResponseProce
for (String query : commandTopDocs.keySet()) {
List<QueryCommandResult> queryCommandResults = commandTopDocs.get(query);
- List<TopDocs> topDocs = new ArrayList<TopDocs>(queryCommandResults.size());
+ List<TopDocs> topDocs = new ArrayList<>(queryCommandResults.size());
int mergedMatches = 0;
for (QueryCommandResult queryCommandResult : queryCommandResults) {
topDocs.add(queryCommandResult.getTopDocs());
@@ -173,7 +173,7 @@ public class TopGroupsShardResponseProce
rb.mergedQueryCommandResults.put(query, new QueryCommandResult(mergedTopDocs, mergedMatches));
}
- Map<Object, ShardDoc> resultIds = new HashMap<Object, ShardDoc>();
+ Map<Object, ShardDoc> resultIds = new HashMap<>();
int i = 0;
for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
for (GroupDocs<BytesRef> group : topGroups.groups) {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java Wed Mar 12 14:39:17 2014
@@ -49,9 +49,9 @@ public class SearchGroupsResultTransform
*/
@Override
public NamedList transform(List<Command> data) throws IOException {
- NamedList<NamedList> result = new NamedList<NamedList>();
+ NamedList<NamedList> result = new NamedList<>();
for (Command command : data) {
- final NamedList<Object> commandResult = new NamedList<Object>();
+ final NamedList<Object> commandResult = new NamedList<>();
if (SearchGroupsFieldCommand.class.isInstance(command)) {
SearchGroupsFieldCommand fieldCommand = (SearchGroupsFieldCommand) command;
Pair<Integer, Collection<SearchGroup<BytesRef>>> pair = fieldCommand.result();
@@ -77,15 +77,15 @@ public class SearchGroupsResultTransform
*/
@Override
public Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) {
- Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> result = new HashMap<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>>();
+ Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> result = new HashMap<>();
for (Map.Entry<String, NamedList> command : shardResponse) {
- List<SearchGroup<BytesRef>> searchGroups = new ArrayList<SearchGroup<BytesRef>>();
+ List<SearchGroup<BytesRef>> searchGroups = new ArrayList<>();
NamedList topGroupsAndGroupCount = command.getValue();
@SuppressWarnings("unchecked")
NamedList<List<Comparable>> rawSearchGroups = (NamedList<List<Comparable>>) topGroupsAndGroupCount.get("topGroups");
if (rawSearchGroups != null) {
for (Map.Entry<String, List<Comparable>> rawSearchGroup : rawSearchGroups){
- SearchGroup<BytesRef> searchGroup = new SearchGroup<BytesRef>();
+ SearchGroup<BytesRef> searchGroup = new SearchGroup<>();
searchGroup.groupValue = rawSearchGroup.getKey() != null ? new BytesRef(rawSearchGroup.getKey()) : null;
searchGroup.sortValues = rawSearchGroup.getValue().toArray(new Comparable[rawSearchGroup.getValue().size()]);
for (int i = 0; i < searchGroup.sortValues.length; i++) {
@@ -108,7 +108,7 @@ public class SearchGroupsResultTransform
}
private NamedList serializeSearchGroup(Collection<SearchGroup<BytesRef>> data, Sort groupSort) {
- NamedList<Object[]> result = new NamedList<Object[]>();
+ NamedList<Object[]> result = new NamedList<>();
for (SearchGroup<BytesRef> searchGroup : data) {
Object[] convertedSortValues = new Object[searchGroup.sortValues.length];
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java Wed Mar 12 14:39:17 2014
@@ -66,7 +66,7 @@ public class TopGroupsResultTransformer
*/
@Override
public NamedList transform(List<Command> data) throws IOException {
- NamedList<NamedList> result = new NamedList<NamedList>();
+ NamedList<NamedList> result = new NamedList<>();
final IndexSchema schema = rb.req.getSearcher().getSchema();
for (Command command : data) {
NamedList commandResult;
@@ -91,7 +91,7 @@ public class TopGroupsResultTransformer
*/
@Override
public Map<String, ?> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) {
- Map<String, Object> result = new HashMap<String, Object>();
+ Map<String, Object> result = new HashMap<>();
final IndexSchema schema = rb.req.getSearcher().getSchema();
@@ -147,7 +147,7 @@ public class TopGroupsResultTransformer
Integer totalHitCount = (Integer) commandResult.get("totalHitCount");
- List<GroupDocs<BytesRef>> groupDocs = new ArrayList<GroupDocs<BytesRef>>();
+ List<GroupDocs<BytesRef>> groupDocs = new ArrayList<>();
for (int i = 2; i < commandResult.size(); i++) {
String groupValue = commandResult.getName(i);
@SuppressWarnings("unchecked")
@@ -182,12 +182,12 @@ public class TopGroupsResultTransformer
}
BytesRef groupValueRef = groupValue != null ? new BytesRef(groupValue) : null;
- groupDocs.add(new GroupDocs<BytesRef>(Float.NaN, maxScore, totalGroupHits, scoreDocs, groupValueRef, null));
+ groupDocs.add(new GroupDocs<>(Float.NaN, maxScore, totalGroupHits, scoreDocs, groupValueRef, null));
}
@SuppressWarnings("unchecked")
GroupDocs<BytesRef>[] groupDocsArr = groupDocs.toArray(new GroupDocs[groupDocs.size()]);
- TopGroups<BytesRef> topGroups = new TopGroups<BytesRef>(
+ TopGroups<BytesRef> topGroups = new TopGroups<>(
groupSort.getSort(), sortWithinGroup.getSort(), totalHitCount, totalGroupedHitCount, groupDocsArr, Float.NaN
);
@@ -198,7 +198,7 @@ public class TopGroupsResultTransformer
}
protected NamedList serializeTopGroups(TopGroups<BytesRef> data, SchemaField groupField) throws IOException {
- NamedList<Object> result = new NamedList<Object>();
+ NamedList<Object> result = new NamedList<>();
result.add("totalGroupedHitCount", data.totalGroupedHitCount);
result.add("totalHitCount", data.totalHitCount);
if (data.totalGroupCount != null) {
@@ -209,15 +209,15 @@ public class TopGroupsResultTransformer
final IndexSchema schema = rb.req.getSearcher().getSchema();
SchemaField uniqueField = schema.getUniqueKeyField();
for (GroupDocs<BytesRef> searchGroup : data.groups) {
- NamedList<Object> groupResult = new NamedList<Object>();
+ NamedList<Object> groupResult = new NamedList<>();
groupResult.add("totalHits", searchGroup.totalHits);
if (!Float.isNaN(searchGroup.maxScore)) {
groupResult.add("maxScore", searchGroup.maxScore);
}
- List<NamedList<Object>> documents = new ArrayList<NamedList<Object>>();
+ List<NamedList<Object>> documents = new ArrayList<>();
for (int i = 0; i < searchGroup.scoreDocs.length; i++) {
- NamedList<Object> document = new NamedList<Object>();
+ NamedList<Object> document = new NamedList<>();
documents.add(document);
StoredDocument doc = retrieveDocument(uniqueField, searchGroup.scoreDocs[i].doc);
@@ -254,20 +254,20 @@ public class TopGroupsResultTransformer
}
protected NamedList serializeTopDocs(QueryCommandResult result) throws IOException {
- NamedList<Object> queryResult = new NamedList<Object>();
+ NamedList<Object> queryResult = new NamedList<>();
queryResult.add("matches", result.getMatches());
queryResult.add("totalHits", result.getTopDocs().totalHits);
if (rb.getGroupingSpec().isNeedScore()) {
queryResult.add("maxScore", result.getTopDocs().getMaxScore());
}
- List<NamedList> documents = new ArrayList<NamedList>();
+ List<NamedList> documents = new ArrayList<>();
queryResult.add("documents", documents);
final IndexSchema schema = rb.req.getSearcher().getSchema();
SchemaField uniqueField = schema.getUniqueKeyField();
CharsRef spare = new CharsRef();
for (ScoreDoc scoreDoc : result.getTopDocs().scoreDocs) {
- NamedList<Object> document = new NamedList<Object>();
+ NamedList<Object> document = new NamedList<>();
documents.add(document);
StoredDocument doc = retrieveDocument(uniqueField, scoreDoc.doc);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java Wed Mar 12 14:39:17 2014
@@ -50,24 +50,24 @@ public class GroupedEndResultTransformer
*/
@Override
public void transform(Map<String, ?> result, ResponseBuilder rb, SolrDocumentSource solrDocumentSource) {
- NamedList<Object> commands = new SimpleOrderedMap<Object>();
+ NamedList<Object> commands = new SimpleOrderedMap<>();
for (Map.Entry<String, ?> entry : result.entrySet()) {
Object value = entry.getValue();
if (TopGroups.class.isInstance(value)) {
@SuppressWarnings("unchecked")
TopGroups<BytesRef> topGroups = (TopGroups<BytesRef>) value;
- NamedList<Object> command = new SimpleOrderedMap<Object>();
+ NamedList<Object> command = new SimpleOrderedMap<>();
command.add("matches", rb.totalHitCount);
Integer totalGroupCount = rb.mergedGroupCounts.get(entry.getKey());
if (totalGroupCount != null) {
command.add("ngroups", totalGroupCount);
}
- List<NamedList> groups = new ArrayList<NamedList>();
+ List<NamedList> groups = new ArrayList<>();
SchemaField groupField = searcher.getSchema().getField(entry.getKey());
FieldType groupFieldType = groupField.getType();
for (GroupDocs<BytesRef> group : topGroups.groups) {
- SimpleOrderedMap<Object> groupResult = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> groupResult = new SimpleOrderedMap<>();
if (group.groupValue != null) {
groupResult.add(
"groupValue", groupFieldType.toObject(groupField.createField(group.groupValue.utf8ToString(), 1.0f))
@@ -91,7 +91,7 @@ public class GroupedEndResultTransformer
commands.add(entry.getKey(), command);
} else if (QueryCommandResult.class.isInstance(value)) {
QueryCommandResult queryCommandResult = (QueryCommandResult) value;
- NamedList<Object> command = new SimpleOrderedMap<Object>();
+ NamedList<Object> command = new SimpleOrderedMap<>();
command.add("matches", queryCommandResult.getMatches());
SolrDocumentList docList = new SolrDocumentList();
docList.setNumFound(queryCommandResult.getTopDocs().totalHits);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/SimpleEndResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/SimpleEndResultTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/SimpleEndResultTransformer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/SimpleEndResultTransformer.java Wed Mar 12 14:39:17 2014
@@ -38,13 +38,13 @@ public class SimpleEndResultTransformer
*/
@Override
public void transform(Map<String, ?> result, ResponseBuilder rb, SolrDocumentSource solrDocumentSource) {
- NamedList<Object> commands = new SimpleOrderedMap<Object>();
+ NamedList<Object> commands = new SimpleOrderedMap<>();
for (Map.Entry<String, ?> entry : result.entrySet()) {
Object value = entry.getValue();
if (TopGroups.class.isInstance(value)) {
@SuppressWarnings("unchecked")
TopGroups<BytesRef> topGroups = (TopGroups<BytesRef>) value;
- NamedList<Object> command = new SimpleOrderedMap<Object>();
+ NamedList<Object> command = new SimpleOrderedMap<>();
command.add("matches", rb.totalHitCount);
if (topGroups.totalGroupCount != null) {
command.add("ngroups", topGroups.totalGroupCount);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java Wed Mar 12 14:39:17 2014
@@ -118,7 +118,7 @@ public class DirectSolrConnection
params = new MapSolrParams( new HashMap<String, String>() );
// Make a stream for the 'body' content
- List<ContentStream> streams = new ArrayList<ContentStream>( 1 );
+ List<ContentStream> streams = new ArrayList<>( 1 );
if( body != null && body.length() > 0 ) {
streams.add( new ContentStreamBase.StringStream( body ) );
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Wed Mar 12 14:39:17 2014
@@ -479,7 +479,7 @@ public class SolrDispatchFilter implemen
collectionsList = StrUtils.splitSmart(collection, ",", true);
}
if (collectionsList != null) {
- Set<String> newCollectionsList = new HashSet<String>(
+ Set<String> newCollectionsList = new HashSet<>(
collectionsList.size());
for (String col : collectionsList) {
String al = aliases.getCollectionAlias(col);
@@ -601,7 +601,7 @@ public class SolrDispatchFilter implemen
boolean byCoreName = false;
if (slices == null) {
- slices = new ArrayList<Slice>();
+ slices = new ArrayList<>();
// look by core name
byCoreName = true;
slices = getSlicesForCollections(clusterState, slices, true);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java Wed Mar 12 14:39:17 2014
@@ -76,7 +76,7 @@ public class SolrRequestParsers
private static final byte[] INPUT_ENCODING_BYTES = INPUT_ENCODING_KEY.getBytes(CHARSET_US_ASCII);
private final HashMap<String, SolrRequestParser> parsers =
- new HashMap<String, SolrRequestParser>();
+ new HashMap<>();
private final boolean enableRemoteStreams;
private StandardRequestParser standard;
private boolean handleSelect = true;
@@ -141,7 +141,7 @@ public class SolrRequestParsers
// TODO -- in the future, we could pick a different parser based on the request
// Pick the parser from the request...
- ArrayList<ContentStream> streams = new ArrayList<ContentStream>(1);
+ ArrayList<ContentStream> streams = new ArrayList<>(1);
SolrParams params = parser.parseParamsAndFillStreams( req, streams );
SolrQueryRequest sreq = buildRequestFrom( core, params, streams );
@@ -213,7 +213,7 @@ public class SolrRequestParsers
* Given a url-encoded query string (UTF-8), map it into solr params
*/
public static MultiMapSolrParams parseQueryString(String queryString) {
- Map<String,String[]> map = new HashMap<String, String[]>();
+ Map<String,String[]> map = new HashMap<>();
parseQueryString(queryString, map);
return new MultiMapSolrParams(map);
}
@@ -261,7 +261,7 @@ public class SolrRequestParsers
@SuppressWarnings({"fallthrough", "resource"})
static long parseFormDataContent(final InputStream postContent, final long maxLen, Charset charset, final Map<String,String[]> map, boolean supportCharsetParam) throws IOException {
CharsetDecoder charsetDecoder = supportCharsetParam ? null : getCharsetDecoder(charset);
- final LinkedList<Object> buffer = supportCharsetParam ? new LinkedList<Object>() : null;
+ final LinkedList<Object> buffer = supportCharsetParam ? new LinkedList<>() : null;
long len = 0L, keyPos = 0L, valuePos = 0L;
final ByteArrayOutputStream keyStream = new ByteArrayOutputStream(),
valueStream = new ByteArrayOutputStream();
@@ -580,7 +580,7 @@ public class SolrRequestParsers
throw new SolrException( ErrorCode.BAD_REQUEST, "Not application/x-www-form-urlencoded content: "+req.getContentType() );
}
- final Map<String,String[]> map = new HashMap<String, String[]>();
+ final Map<String,String[]> map = new HashMap<>();
// also add possible URL parameters and include into the map (parsed using UTF-8):
final String qs = req.getQueryString();
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java Wed Mar 12 14:39:17 2014
@@ -56,7 +56,7 @@ public final class HttpCacheHeaderUtil {
* @see #calcEtag
*/
private static Map<SolrCore, EtagCacheVal> etagCoreCache
- = new WeakHashMap<SolrCore, EtagCacheVal>();
+ = new WeakHashMap<>();
/** @see #etagCoreCache */
private static class EtagCacheVal {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java Wed Mar 12 14:39:17 2014
@@ -45,7 +45,7 @@ public class ConjunctionSolrSpellChecker
private Float accuracy = null;
private String dictionaryName = null;
private Analyzer queryAnalyzer = null;
- private List<SolrSpellChecker> checkers = new ArrayList<SolrSpellChecker>();
+ private List<SolrSpellChecker> checkers = new ArrayList<>();
private boolean initalized = false;
public void addChecker(SolrSpellChecker checker) {
@@ -136,8 +136,8 @@ public class ConjunctionSolrSpellChecker
//TODO: This just interleaves the results. In the future, we might want to let users give each checker its
// own weight and use that in combination to score & frequency to sort the results ?
private SpellingResult mergeCheckers(SpellingResult[] results, int numSug) {
- Map<Token, Integer> combinedTokenFrequency = new HashMap<Token, Integer>();
- Map<Token, List<LinkedHashMap<String, Integer>>> allSuggestions = new LinkedHashMap<Token, List<LinkedHashMap<String, Integer>>>();
+ Map<Token, Integer> combinedTokenFrequency = new HashMap<>();
+ Map<Token, List<LinkedHashMap<String, Integer>>> allSuggestions = new LinkedHashMap<>();
for(SpellingResult result : results) {
if(result.getTokenFrequency()!=null) {
combinedTokenFrequency.putAll(result.getTokenFrequency());
@@ -145,7 +145,7 @@ public class ConjunctionSolrSpellChecker
for(Map.Entry<Token, LinkedHashMap<String, Integer>> entry : result.getSuggestions().entrySet()) {
List<LinkedHashMap<String, Integer>> allForThisToken = allSuggestions.get(entry.getKey());
if(allForThisToken==null) {
- allForThisToken = new ArrayList<LinkedHashMap<String, Integer>>();
+ allForThisToken = new ArrayList<>();
allSuggestions.put(entry.getKey(), allForThisToken);
}
allForThisToken.add(entry.getValue());
@@ -154,7 +154,7 @@ public class ConjunctionSolrSpellChecker
SpellingResult combinedResult = new SpellingResult();
for(Map.Entry<Token, List<LinkedHashMap<String, Integer>>> entry : allSuggestions.entrySet()) {
Token original = entry.getKey();
- List<Iterator<Map.Entry<String,Integer>>> corrIters = new ArrayList<Iterator<Map.Entry<String,Integer>>>(entry.getValue().size());
+ List<Iterator<Map.Entry<String,Integer>>> corrIters = new ArrayList<>(entry.getValue().size());
for(LinkedHashMap<String, Integer> corrections : entry.getValue()) {
corrIters.add(corrections.entrySet().iterator());
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/PossibilityIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/PossibilityIterator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/PossibilityIterator.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/PossibilityIterator.java Wed Mar 12 14:39:17 2014
@@ -44,7 +44,7 @@ import org.apache.lucene.analysis.Token;
*/
public class PossibilityIterator implements
Iterator<PossibilityIterator.RankedSpellPossibility> {
- private List<List<SpellCheckCorrection>> possibilityList = new ArrayList<List<SpellCheckCorrection>>();
+ private List<List<SpellCheckCorrection>> possibilityList = new ArrayList<>();
private Iterator<RankedSpellPossibility> rankedPossibilityIterator = null;
private int correctionIndex[];
private boolean done = false;
@@ -74,7 +74,7 @@ public class PossibilityIterator impleme
if (entry.getValue().size() == 0) {
continue;
}
- List<SpellCheckCorrection> possibleCorrections = new ArrayList<SpellCheckCorrection>();
+ List<SpellCheckCorrection> possibleCorrections = new ArrayList<>();
for (Map.Entry<String,Integer> entry1 : entry.getValue().entrySet()) {
SpellCheckCorrection correction = new SpellCheckCorrection();
correction.setOriginal(token);
@@ -99,11 +99,11 @@ public class PossibilityIterator impleme
correctionIndex[i] = 0;
}
}
- PriorityQueue<RankedSpellPossibility> rankedPossibilities = new PriorityQueue<RankedSpellPossibility>(
+ PriorityQueue<RankedSpellPossibility> rankedPossibilities = new PriorityQueue<>(
11, new RankComparator());
Set<RankedSpellPossibility> removeDuplicates = null;
if (suggestionsMayOverlap) {
- removeDuplicates = new HashSet<RankedSpellPossibility>();
+ removeDuplicates = new HashSet<>();
}
long numEvaluations = 0;
while (numEvaluations < maxEvaluations && internalHasNext()) {
@@ -206,7 +206,7 @@ public class PossibilityIterator impleme
if (done) {
throw new NoSuchElementException();
}
- possibleCorrection = new ArrayList<SpellCheckCorrection>();
+ possibleCorrection = new ArrayList<>();
List<List<SpellCheckCorrection>> possibleCorrections = null;
int rank = 0;
while (!done
@@ -244,7 +244,7 @@ public class PossibilityIterator impleme
if (suggestionsMayOverlap) {
possibleCorrections = separateOverlappingTokens(possibleCorrection);
} else {
- possibleCorrections = new ArrayList<List<SpellCheckCorrection>>(1);
+ possibleCorrections = new ArrayList<>(1);
possibleCorrections.add(possibleCorrection);
}
}
@@ -258,11 +258,11 @@ public class PossibilityIterator impleme
List<SpellCheckCorrection> possibleCorrection) {
List<List<SpellCheckCorrection>> ret = null;
if (possibleCorrection.size() == 1) {
- ret = new ArrayList<List<SpellCheckCorrection>>(1);
+ ret = new ArrayList<>(1);
ret.add(possibleCorrection);
return ret;
}
- ret = new ArrayList<List<SpellCheckCorrection>>();
+ ret = new ArrayList<>();
for (int i = 0; i < possibleCorrection.size(); i++) {
List<SpellCheckCorrection> c = compatible(possibleCorrection, i);
ret.add(c);
@@ -274,7 +274,7 @@ public class PossibilityIterator impleme
int pos) {
List<SpellCheckCorrection> priorPassCompatibles = null;
{
- List<SpellCheckCorrection> firstPassCompatibles = new ArrayList<SpellCheckCorrection>(
+ List<SpellCheckCorrection> firstPassCompatibles = new ArrayList<>(
all.size());
SpellCheckCorrection sacred = all.get(pos);
firstPassCompatibles.add(sacred);
@@ -303,7 +303,7 @@ public class PossibilityIterator impleme
if (pos == priorPassCompatibles.size() - 1) {
return priorPassCompatibles;
}
- List<SpellCheckCorrection> subsequentPassCompatibles = new ArrayList<SpellCheckCorrection>(
+ List<SpellCheckCorrection> subsequentPassCompatibles = new ArrayList<>(
priorPassCompatibles.size());
SpellCheckCorrection sacred = null;
for (int i = 0; i <= pos; i++) {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java Wed Mar 12 14:39:17 2014
@@ -138,7 +138,7 @@ public abstract class SolrSpellChecker {
for (SuggestWord word : suggestions)
result.add(token, word.string, word.freq);
} else {
- List<String> words = new ArrayList<String>(sugQueue.size());
+ List<String> words = new ArrayList<>(sugQueue.size());
for (SuggestWord word : suggestions) words.add(word.string);
result.add(token, words);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellCheckCollator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellCheckCollator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellCheckCollator.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellCheckCollator.java Wed Mar 12 14:39:17 2014
@@ -50,7 +50,7 @@ public class SpellCheckCollator {
public List<SpellCheckCollation> collate(SpellingResult result,
String originalQuery, ResponseBuilder ultimateResponse) {
- List<SpellCheckCollation> collations = new ArrayList<SpellCheckCollation>();
+ List<SpellCheckCollation> collations = new ArrayList<>();
QueryComponent queryComponent = null;
if (ultimateResponse.components != null) {
@@ -169,7 +169,7 @@ public class SpellCheckCollator {
collation.setHits(hits);
collation.setInternalRank(suggestionsMayOverlap ? ((possibility.rank * 1000) + possibility.index) : possibility.rank);
- NamedList<String> misspellingsAndCorrections = new NamedList<String>();
+ NamedList<String> misspellingsAndCorrections = new NamedList<>();
for (SpellCheckCorrection corr : possibility.corrections) {
misspellingsAndCorrections.add(corr.getOriginal().toString(), corr.getCorrection());
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingQueryConverter.java Wed Mar 12 14:39:17 2014
@@ -104,7 +104,7 @@ public class SpellingQueryConverter exte
if (original == null) { // this can happen with q.alt = and no query
return Collections.emptyList();
}
- Collection<Token> result = new ArrayList<Token>();
+ Collection<Token> result = new ArrayList<>();
Matcher matcher = QUERY_REGEX.matcher(original);
String nextWord = null;
int nextStartIndex = 0;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingResult.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingResult.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingResult.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SpellingResult.java Wed Mar 12 14:39:17 2014
@@ -37,7 +37,7 @@ public class SpellingResult {
* Key == token
* Value = Map -> key is the suggestion, value is the frequency of the token in the collection
*/
- private Map<Token, LinkedHashMap<String, Integer>> suggestions = new LinkedHashMap<Token, LinkedHashMap<String, Integer>>();
+ private Map<Token, LinkedHashMap<String, Integer>> suggestions = new LinkedHashMap<>();
private Map<Token, Integer> tokenFrequency;
public static final int NO_FREQUENCY_INFO = -1;
@@ -58,7 +58,7 @@ public class SpellingResult {
public void add(Token token, List<String> suggestions) {
LinkedHashMap<String, Integer> map = this.suggestions.get(token);
if (map == null ) {
- map = new LinkedHashMap<String, Integer>();
+ map = new LinkedHashMap<>();
this.suggestions.put(token, map);
}
for (String suggestion : suggestions) {
@@ -74,7 +74,7 @@ public class SpellingResult {
*/
public void addFrequency(Token token, int docFreq) {
if (tokenFrequency == null) {
- tokenFrequency = new LinkedHashMap<Token, Integer>();
+ tokenFrequency = new LinkedHashMap<>();
}
tokenFrequency.put(token, docFreq);
}
@@ -89,7 +89,7 @@ public class SpellingResult {
LinkedHashMap<String, Integer> map = this.suggestions.get(token);
//Don't bother adding if we already have this token
if (map == null) {
- map = new LinkedHashMap<String, Integer>();
+ map = new LinkedHashMap<>();
this.suggestions.put(token, map);
}
map.put(suggestion, docFreq);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SuggestQueryConverter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SuggestQueryConverter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SuggestQueryConverter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/SuggestQueryConverter.java Wed Mar 12 14:39:17 2014
@@ -35,7 +35,7 @@ public class SuggestQueryConverter exten
return Collections.emptyList();
}
- Collection<Token> result = new ArrayList<Token>();
+ Collection<Token> result = new ArrayList<>();
try {
analyze(result, original, 0, 0);
} catch (IOException e) {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java Wed Mar 12 14:39:17 2014
@@ -199,9 +199,9 @@ public class WordBreakSolrSpellChecker e
StringBuilder sb = new StringBuilder();
Token[] tokenArr = options.tokens.toArray(new Token[options.tokens.size()]);
- List<Term> termArr = new ArrayList<Term>(options.tokens.size() + 2);
+ List<Term> termArr = new ArrayList<>(options.tokens.size() + 2);
- List<ResultEntry> breakSuggestionList = new ArrayList<ResultEntry>();
+ List<ResultEntry> breakSuggestionList = new ArrayList<>();
boolean lastOneProhibited = false;
boolean lastOneRequired = false;
boolean lastOneprocedesNewBooleanOp = false;
@@ -253,7 +253,7 @@ public class WordBreakSolrSpellChecker e
CombineSuggestion[] combineSuggestions = wbsp.suggestWordCombinations(
termArr.toArray(new Term[termArr.size()]), numSuggestions, ir, options.suggestMode);
if (combineWords) {
- combineSuggestionList = new ArrayList<ResultEntry>(
+ combineSuggestionList = new ArrayList<>(
combineSuggestions.length);
for (CombineSuggestion cs : combineSuggestions) {
int firstTermIndex = cs.originalTermIndexes[0];
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java Wed Mar 12 14:39:17 2014
@@ -68,7 +68,7 @@ public class DocumentExpressionDictionar
String field = (String) params.get(FIELD);
String payloadField = (String) params.get(PAYLOAD_FIELD);
String weightExpression = (String) params.get(WEIGHT_EXPRESSION);
- Set<SortField> sortFields = new HashSet<SortField>();
+ Set<SortField> sortFields = new HashSet<>();
if (field == null) {
throw new IllegalArgumentException(FIELD + " is a mandatory parameter");
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/SuggesterResult.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/SuggesterResult.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/SuggesterResult.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/suggest/SuggesterResult.java Wed Mar 12 14:39:17 2014
@@ -35,7 +35,7 @@ public class SuggesterResult {
/** token -> lookup results mapping*/
private Map<String, Map<String, List<LookupResult>>> suggestionsMap =
- new HashMap<String, Map<String, List<LookupResult>>>();
+ new HashMap<>();
/** Add suggestion results for <code>token</code> */
public void add(String suggesterName, String token, List<LookupResult> results) {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BlockDirectoryCache.java Wed Mar 12 14:39:17 2014
@@ -27,7 +27,7 @@ import java.util.concurrent.atomic.Atomi
public class BlockDirectoryCache implements Cache {
private final BlockCache blockCache;
private AtomicInteger counter = new AtomicInteger();
- private Map<String,Integer> names = new ConcurrentHashMap<String,Integer>();
+ private Map<String,Integer> names = new ConcurrentHashMap<>();
private String path;
private Metrics metrics;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/BufferStore.java Wed Mar 12 14:39:17 2014
@@ -39,7 +39,7 @@ public class BufferStore implements Stor
}
};
- private final static ConcurrentMap<Integer, BufferStore> bufferStores = new ConcurrentHashMap<Integer, BufferStore>();
+ private final static ConcurrentMap<Integer, BufferStore> bufferStores = new ConcurrentHashMap<>();
private final BlockingQueue<byte[]> buffers;
@@ -66,7 +66,7 @@ public class BufferStore implements Stor
}
private static BlockingQueue<byte[]> setupBuffers(int bufferSize, int count) {
- BlockingQueue<byte[]> queue = new ArrayBlockingQueue<byte[]>(count);
+ BlockingQueue<byte[]> queue = new ArrayBlockingQueue<>(count);
for (int i = 0; i < count; i++) {
queue.add(new byte[bufferSize]);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/blockcache/Metrics.java Wed Mar 12 14:39:17 2014
@@ -53,7 +53,7 @@ public class Metrics implements Updater
public AtomicLong shardBuffercacheAllocate8192 = new AtomicLong(0);
public AtomicLong shardBuffercacheAllocateOther = new AtomicLong(0);
public AtomicLong shardBuffercacheLost = new AtomicLong(0);
- public Map<String,MethodCall> methodCalls = new ConcurrentHashMap<String, MethodCall>();
+ public Map<String,MethodCall> methodCalls = new ConcurrentHashMap<>();
public AtomicLong tableCount = new AtomicLong(0);
public AtomicLong rowCount = new AtomicLong(0);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java Wed Mar 12 14:39:17 2014
@@ -163,7 +163,7 @@ public class HdfsDirectory extends BaseD
@Override
public String[] listAll() throws IOException {
FileStatus[] listStatus = getFileSystem().listStatus(hdfsDirPath);
- List<String> files = new ArrayList<String>();
+ List<String> files = new ArrayList<>();
if (listStatus == null) {
return new String[] {};
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java Wed Mar 12 14:39:17 2014
@@ -193,7 +193,7 @@ public class AddUpdateCommand extends Up
}
private List<SolrInputDocument> flatten(SolrInputDocument root) {
- List<SolrInputDocument> unwrappedDocs = new ArrayList<SolrInputDocument>();
+ List<SolrInputDocument> unwrappedDocs = new ArrayList<>();
recUnwrapp(unwrappedDocs, root);
return unwrappedDocs;
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Wed Mar 12 14:39:17 2014
@@ -201,7 +201,7 @@ public class DirectUpdateHandler2 extend
if (deletesAfter != null) {
log.info("Reordered DBQs detected. Update=" + cmd + " DBQs="
+ deletesAfter);
- List<Query> dbqList = new ArrayList<Query>(deletesAfter.size());
+ List<Query> dbqList = new ArrayList<>(deletesAfter.size());
for (UpdateLog.DBQ dbq : deletesAfter) {
try {
DeleteUpdateCommand tmpDel = new DeleteUpdateCommand(cmd.req);
@@ -493,7 +493,7 @@ public class DirectUpdateHandler2 extend
log.info("start "+cmd);
RefCounted<IndexWriter> iw = solrCoreState.getIndexWriter(core);
try {
- final Map<String,String> commitData = new HashMap<String,String>();
+ final Map<String,String> commitData = new HashMap<>();
commitData.put(SolrIndexWriter.COMMIT_TIME_MSEC_KEY,
String.valueOf(System.currentTimeMillis()));
iw.get().setCommitData(commitData);
@@ -571,7 +571,7 @@ public class DirectUpdateHandler2 extend
// SolrCore.verbose("writer.commit() start writer=",writer);
if (writer.hasUncommittedChanges()) {
- final Map<String,String> commitData = new HashMap<String,String>();
+ final Map<String,String> commitData = new HashMap<>();
commitData.put(SolrIndexWriter.COMMIT_TIME_MSEC_KEY,
String.valueOf(System.currentTimeMillis()));
writer.setCommitData(commitData);
@@ -759,7 +759,7 @@ public class DirectUpdateHandler2 extend
}
// todo: refactor this shared code (or figure out why a real CommitUpdateCommand can't be used)
- final Map<String,String> commitData = new HashMap<String,String>();
+ final Map<String,String> commitData = new HashMap<>();
commitData.put(SolrIndexWriter.COMMIT_TIME_MSEC_KEY, String.valueOf(System.currentTimeMillis()));
writer.setCommitData(commitData);
writer.commit();
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsTransactionLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsTransactionLog.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsTransactionLog.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsTransactionLog.java Wed Mar 12 14:39:17 2014
@@ -191,7 +191,7 @@ public class HdfsTransactionLog extends
synchronized (this) {
globalStringList = (List<String>)header.get("strings");
- globalStringMap = new HashMap<String, Integer>(globalStringList.size());
+ globalStringMap = new HashMap<>(globalStringList.size());
for (int i=0; i<globalStringList.size(); i++) {
globalStringMap.put( globalStringList.get(i), i+1);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java Wed Mar 12 14:39:17 2014
@@ -329,7 +329,7 @@ public class HdfsUpdateLog extends Updat
return name.getName().startsWith(prefix);
}
});
- List<String> fileList = new ArrayList<String>(files.length);
+ List<String> fileList = new ArrayList<>(files.length);
for (FileStatus file : files) {
fileList.add(file.getPath().getName());
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/MemOutputStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/MemOutputStream.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/MemOutputStream.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/MemOutputStream.java Wed Mar 12 14:39:17 2014
@@ -25,7 +25,7 @@ import java.util.List;
/** @lucene.internal */
public class MemOutputStream extends FastOutputStream {
- public List<byte[]> buffers = new LinkedList<byte[]>();
+ public List<byte[]> buffers = new LinkedList<>();
public MemOutputStream(byte[] tempBuffer) {
super(null, tempBuffer, 0);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/PeerSync.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/PeerSync.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/PeerSync.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/PeerSync.java Wed Mar 12 14:39:17 2014
@@ -227,7 +227,7 @@ public class PeerSync {
}
// let's merge the lists
- List<Long> newList = new ArrayList<Long>(ourUpdates);
+ List<Long> newList = new ArrayList<>(ourUpdates);
for (Long ver : startingVersions) {
if (Math.abs(ver) < smallestNewUpdate) {
newList.add(ver);
@@ -248,8 +248,8 @@ public class PeerSync {
}
}
- ourUpdateSet = new HashSet<Long>(ourUpdates);
- requestedUpdateSet = new HashSet<Long>(ourUpdates);
+ ourUpdateSet = new HashSet<>(ourUpdates);
+ requestedUpdateSet = new HashSet<>(ourUpdates);
for(;;) {
ShardResponse srsp = shardHandler.takeCompletedOrError();
@@ -390,7 +390,7 @@ public class PeerSync {
return true;
}
- List<Long> toRequest = new ArrayList<Long>();
+ List<Long> toRequest = new ArrayList<>();
for (Long otherVersion : otherVersions) {
// stop when the entries get old enough that reorders may lead us to see updates we don't need
if (!completeList && Math.abs(otherVersion) < ourLowThreshold) break;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java Wed Mar 12 14:39:17 2014
@@ -47,8 +47,8 @@ public class SolrCmdDistributor {
private int retryPause = 500;
private int maxRetriesOnForward = MAX_RETRIES_ON_FORWARD;
- private List<Error> allErrors = new ArrayList<Error>();
- private List<Error> errors = new ArrayList<Error>();
+ private List<Error> allErrors = new ArrayList<>();
+ private List<Error> errors = new ArrayList<>();
public static interface AbortCheck {
public boolean abortCheck();
@@ -76,9 +76,9 @@ public class SolrCmdDistributor {
private void doRetriesIfNeeded() {
// NOTE: retries will be forwards to a single url
- List<Error> errors = new ArrayList<Error>(this.errors);
+ List<Error> errors = new ArrayList<>(this.errors);
errors.addAll(servers.getErrors());
- List<Error> resubmitList = new ArrayList<Error>();
+ List<Error> resubmitList = new ArrayList<>();
for (Error err : errors) {
try {
@@ -266,7 +266,7 @@ public class SolrCmdDistributor {
public static class Response {
- public List<Error> errors = new ArrayList<Error>();
+ public List<Error> errors = new ArrayList<>();
}
public static class Error {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexSplitter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexSplitter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexSplitter.java Wed Mar 12 14:39:17 2014
@@ -90,7 +90,7 @@ public class SolrIndexSplitter {
public void split() throws IOException {
List<AtomicReaderContext> leaves = searcher.getTopReaderContext().leaves();
- List<FixedBitSet[]> segmentDocSets = new ArrayList<FixedBitSet[]>(leaves.size());
+ List<FixedBitSet[]> segmentDocSets = new ArrayList<>(leaves.size());
log.info("SolrIndexSplitter: partitions=" + numPieces + " segments="+leaves.size());
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/StreamingSolrServers.java Wed Mar 12 14:39:17 2014
@@ -43,7 +43,7 @@ public class StreamingSolrServers {
private HttpClient httpClient;
- private Map<String,ConcurrentUpdateSolrServer> solrServers = new HashMap<String,ConcurrentUpdateSolrServer>();
+ private Map<String,ConcurrentUpdateSolrServer> solrServers = new HashMap<>();
private List<Error> errors = Collections.synchronizedList(new ArrayList<Error>());
private ExecutorService updateExecutor;
@@ -82,7 +82,7 @@ public class StreamingSolrServers {
server.setParser(new BinaryResponseParser());
server.setRequestWriter(new BinaryRequestWriter());
server.setPollQueueTime(0);
- Set<String> queryParams = new HashSet<String>(2);
+ Set<String> queryParams = new HashSet<>(2);
queryParams.add(DistributedUpdateProcessor.DISTRIB_FROM);
queryParams.add(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM);
server.setQueryParams(queryParams);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/TransactionLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/TransactionLog.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/TransactionLog.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/TransactionLog.java Wed Mar 12 14:39:17 2014
@@ -77,8 +77,8 @@ public class TransactionLog {
protected volatile boolean deleteOnClose = true; // we can delete old tlogs since they are currently only used for real-time-get (and in the future, recovery)
AtomicInteger refcount = new AtomicInteger(1);
- Map<String,Integer> globalStringMap = new HashMap<String, Integer>();
- List<String> globalStringList = new ArrayList<String>();
+ Map<String,Integer> globalStringMap = new HashMap<>();
+ List<String> globalStringList = new ArrayList<>();
long snapshot_size;
int snapshot_numRecords;
@@ -271,7 +271,7 @@ public class TransactionLog {
synchronized (this) {
globalStringList = (List<String>)header.get("strings");
- globalStringMap = new HashMap<String, Integer>(globalStringList.size());
+ globalStringMap = new HashMap<>(globalStringList.size());
for (int i=0; i<globalStringList.size(); i++) {
globalStringMap.put( globalStringList.get(i), i+1);
}
@@ -295,7 +295,7 @@ public class TransactionLog {
Collection<String> getGlobalStrings() {
synchronized (this) {
- return new ArrayList<String>(globalStringList);
+ return new ArrayList<>(globalStringList);
}
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateHandler.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateHandler.java Wed Mar 12 14:39:17 2014
@@ -49,9 +49,9 @@ public abstract class UpdateHandler impl
protected final SchemaField idField;
protected final FieldType idFieldType;
- protected Vector<SolrEventListener> commitCallbacks = new Vector<SolrEventListener>();
- protected Vector<SolrEventListener> softCommitCallbacks = new Vector<SolrEventListener>();
- protected Vector<SolrEventListener> optimizeCallbacks = new Vector<SolrEventListener>();
+ protected Vector<SolrEventListener> commitCallbacks = new Vector<>();
+ protected Vector<SolrEventListener> softCommitCallbacks = new Vector<>();
+ protected Vector<SolrEventListener> optimizeCallbacks = new Vector<>();
protected final UpdateLog ulog;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateLog.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateLog.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/UpdateLog.java Wed Mar 12 14:39:17 2014
@@ -128,11 +128,11 @@ public class UpdateLog implements Plugin
protected TransactionLog tlog;
protected TransactionLog prevTlog;
- protected Deque<TransactionLog> logs = new LinkedList<TransactionLog>(); // list of recent logs, newest first
- protected LinkedList<TransactionLog> newestLogsOnStartup = new LinkedList<TransactionLog>();
+ protected Deque<TransactionLog> logs = new LinkedList<>(); // list of recent logs, newest first
+ protected LinkedList<TransactionLog> newestLogsOnStartup = new LinkedList<>();
protected int numOldRecords; // number of records in the recent logs
- protected Map<BytesRef,LogPtr> map = new HashMap<BytesRef, LogPtr>();
+ protected Map<BytesRef,LogPtr> map = new HashMap<>();
protected Map<BytesRef,LogPtr> prevMap; // used while committing/reopening is happening
protected Map<BytesRef,LogPtr> prevMap2; // used while committing/reopening is happening
protected TransactionLog prevMapLog; // the transaction log used to look up entries found in prevMap
@@ -160,7 +160,7 @@ public class UpdateLog implements Plugin
}
}
- protected LinkedList<DBQ> deleteByQueries = new LinkedList<DBQ>();
+ protected LinkedList<DBQ> deleteByQueries = new LinkedList<>();
protected String[] tlogFiles;
protected File tlogDir;
@@ -566,7 +566,7 @@ public class UpdateLog implements Plugin
return null;
}
- List<DBQ> dbqList = new ArrayList<DBQ>();
+ List<DBQ> dbqList = new ArrayList<>();
for (DBQ dbq : deleteByQueries) {
if (dbq.version <= version) break;
dbqList.add(dbq);
@@ -582,7 +582,7 @@ public class UpdateLog implements Plugin
prevMap = map;
prevMapLog = tlog;
- map = new HashMap<BytesRef, LogPtr>();
+ map = new HashMap<>();
}
private void clearOldMaps() {
@@ -656,7 +656,7 @@ public class UpdateLog implements Plugin
// any added documents will make it into this commit or not.
// But we do know that any updates already added will definitely
// show up in the latest reader after the commit succeeds.
- map = new HashMap<BytesRef, LogPtr>();
+ map = new HashMap<>();
if (debug) {
log.debug("TLOG: preSoftCommit: prevMap="+ System.identityHashCode(prevMap) + " new map=" + System.identityHashCode(map));
@@ -792,7 +792,7 @@ public class UpdateLog implements Plugin
public Future<RecoveryInfo> recoverFromLog() {
recoveryInfo = new RecoveryInfo();
- List<TransactionLog> recoverLogs = new ArrayList<TransactionLog>(1);
+ List<TransactionLog> recoverLogs = new ArrayList<>(1);
for (TransactionLog ll : newestLogsOnStartup) {
if (!ll.try_incref()) continue;
@@ -812,7 +812,7 @@ public class UpdateLog implements Plugin
if (recoverLogs.isEmpty()) return null;
- ExecutorCompletionService<RecoveryInfo> cs = new ExecutorCompletionService<RecoveryInfo>(recoveryExecutor);
+ ExecutorCompletionService<RecoveryInfo> cs = new ExecutorCompletionService<>(recoveryExecutor);
LogReplayer replayer = new LogReplayer(recoverLogs, false);
versionInfo.blockUpdates();
@@ -925,7 +925,7 @@ public class UpdateLog implements Plugin
/** Returns the list of deleteByQueries that happened after the given version */
public List<Object> getDeleteByQuery(long afterVersion) {
- List<Object> result = new ArrayList<Object>(deleteByQueryList.size());
+ List<Object> result = new ArrayList<>(deleteByQueryList.size());
for (Update update : deleteByQueryList) {
if (Math.abs(update.version) > afterVersion) {
Object dbq = update.log.lookup(update.pointer);
@@ -942,13 +942,13 @@ public class UpdateLog implements Plugin
private void update() {
int numUpdates = 0;
- updateList = new ArrayList<List<Update>>(logList.size());
- deleteByQueryList = new ArrayList<Update>();
- deleteList = new ArrayList<DeleteUpdate>();
- updates = new HashMap<Long,Update>(numRecordsToKeep);
+ updateList = new ArrayList<>(logList.size());
+ deleteByQueryList = new ArrayList<>();
+ deleteList = new ArrayList<>();
+ updates = new HashMap<>(numRecordsToKeep);
for (TransactionLog oldLog : logList) {
- List<Update> updatesForLog = new ArrayList<Update>();
+ List<Update> updatesForLog = new ArrayList<>();
TransactionLog.ReverseReader reader = null;
try {
@@ -1030,7 +1030,7 @@ public class UpdateLog implements Plugin
public RecentUpdates getRecentUpdates() {
Deque<TransactionLog> logList;
synchronized (this) {
- logList = new LinkedList<TransactionLog>(logs);
+ logList = new LinkedList<>(logs);
for (TransactionLog log : logList) {
log.incref();
}
@@ -1156,7 +1156,7 @@ public class UpdateLog implements Plugin
tlog.decref();
throw new RuntimeException("executor is not running...");
}
- ExecutorCompletionService<RecoveryInfo> cs = new ExecutorCompletionService<RecoveryInfo>(recoveryExecutor);
+ ExecutorCompletionService<RecoveryInfo> cs = new ExecutorCompletionService<>(recoveryExecutor);
LogReplayer replayer = new LogReplayer(Arrays.asList(new TransactionLog[]{tlog}), true);
return cs.submit(replayer, recoveryInfo);
}
@@ -1188,7 +1188,7 @@ public class UpdateLog implements Plugin
boolean debug = loglog.isDebugEnabled();
public LogReplayer(List<TransactionLog> translogs, boolean activeLog) {
- this.translogs = new LinkedList<TransactionLog>();
+ this.translogs = new LinkedList<>();
this.translogs.addAll(translogs);
this.activeLog = activeLog;
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java Wed Mar 12 14:39:17 2014
@@ -126,7 +126,7 @@ public class AddSchemaFieldsUpdateProces
private List<TypeMapping> typeMappings = Collections.emptyList();
private SelectorParams inclusions = new SelectorParams();
- private Collection<SelectorParams> exclusions = new ArrayList<SelectorParams>();
+ private Collection<SelectorParams> exclusions = new ArrayList<>();
private FieldNameSelector selector = null;
private String defaultFieldType;
@@ -191,7 +191,7 @@ public class AddSchemaFieldsUpdateProces
}
private static List<TypeMapping> parseTypeMappings(NamedList args) {
- List<TypeMapping> typeMappings = new ArrayList<TypeMapping>();
+ List<TypeMapping> typeMappings = new ArrayList<>();
List<Object> typeMappingsParams = args.getAll(TYPE_MAPPING_PARAM);
for (Object typeMappingObj : typeMappingsParams) {
if (null == typeMappingObj) {
@@ -262,7 +262,7 @@ public class AddSchemaFieldsUpdateProces
if (null == schema.getFieldTypeByName(fieldTypeName)) {
throw new SolrException(SERVER_ERROR, "fieldType '" + fieldTypeName + "' not found in the schema");
}
- valueClasses = new HashSet<Class<?>>();
+ valueClasses = new HashSet<>();
for (String valueClassName : valueClassNames) {
try {
valueClasses.add(loader.loadClass(valueClassName));
@@ -289,7 +289,7 @@ public class AddSchemaFieldsUpdateProces
final SolrCore core = cmd.getReq().getCore();
for (;;) {
final IndexSchema oldSchema = core.getLatestSchema();
- List<SchemaField> newFields = new ArrayList<SchemaField>();
+ List<SchemaField> newFields = new ArrayList<>();
for (final String fieldName : doc.getFieldNames()) {
if (selector.shouldMutate(fieldName)) {
String fieldTypeName = mapValueClassesToFieldType(doc.getField(fieldName));
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java Wed Mar 12 14:39:17 2014
@@ -87,7 +87,7 @@ public abstract class AllValuesOrNoneFie
if (DELETE_VALUE_SINGLETON == destVal) {
if (log.isDebugEnabled()) {
if (null == messages) {
- messages = new ArrayList<String>();
+ messages = new ArrayList<>();
}
messages.add(String.format(Locale.ROOT, "removing value from field '%s': %s '%s'",
srcField.getName(), srcVal.getClass().getSimpleName(), srcVal));
@@ -95,7 +95,7 @@ public abstract class AllValuesOrNoneFie
} else {
if (log.isDebugEnabled()) {
if (null == messages) {
- messages = new ArrayList<String>();
+ messages = new ArrayList<>();
}
messages.add(String.format(Locale.ROOT, "replace value from field '%s': %s '%s' with %s '%s'",
srcField.getName(), srcVal.getClass().getSimpleName(), srcVal,
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java Wed Mar 12 14:39:17 2014
@@ -108,7 +108,7 @@ public class CloneFieldUpdateProcessorFa
private SelectorParams srcInclusions = new SelectorParams();
private Collection<SelectorParams> srcExclusions
- = new ArrayList<SelectorParams>();
+ = new ArrayList<>();
private FieldNameSelector srcSelector = null;
private String dest = null;
@@ -175,8 +175,7 @@ public class CloneFieldUpdateProcessorFa
}
} else {
// source better be one or more strings
- srcInclusions.fieldName = new HashSet<String>
- (args.removeConfigArgs("source"));
+ srcInclusions.fieldName = new HashSet<>(args.removeConfigArgs("source"));
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Wed Mar 12 14:39:17 2014
@@ -283,13 +283,13 @@ public class DistributedUpdateProcessor
if (replicaProps != null) {
if (nodes == null) {
- nodes = new ArrayList<Node>(replicaProps.size());
+ nodes = new ArrayList<>(replicaProps.size());
}
// check for test param that lets us miss replicas
String[] skipList = req.getParams().getParams(TEST_DISTRIB_SKIP_SERVERS);
Set<String> skipListSet = null;
if (skipList != null) {
- skipListSet = new HashSet<String>(skipList.length);
+ skipListSet = new HashSet<>(skipList.length);
skipListSet.addAll(Arrays.asList(skipList));
log.info("test.distrib.skip.servers was found and contains:" + skipListSet);
}
@@ -309,7 +309,7 @@ public class DistributedUpdateProcessor
} else {
// I need to forward onto the leader...
- nodes = new ArrayList<Node>(1);
+ nodes = new ArrayList<>(1);
nodes.add(new RetryNode(new ZkCoreNodeProps(leaderReplica), zkController.getZkStateReader(), collection, shardId));
forwardToLeader = true;
}
@@ -373,7 +373,7 @@ public class DistributedUpdateProcessor
Replica sliceLeader = aslice.getLeader();
// slice leader can be null because node/shard is created zk before leader election
if (sliceLeader != null && zkController.getClusterState().liveNodesContain(sliceLeader.getNodeName())) {
- if (nodes == null) nodes = new ArrayList<Node>();
+ if (nodes == null) nodes = new ArrayList<>();
ZkCoreNodeProps nodeProps = new ZkCoreNodeProps(sliceLeader);
nodes.add(new StdNode(nodeProps));
}
@@ -400,7 +400,7 @@ public class DistributedUpdateProcessor
Collection<Slice> activeSlices = cstate.getActiveSlices(targetCollectionName);
if (activeSlices != null && !activeSlices.isEmpty()) {
Slice any = activeSlices.iterator().next();
- if (nodes == null) nodes = new ArrayList<Node>();
+ if (nodes == null) nodes = new ArrayList<>();
nodes.add(new StdNode(new ZkCoreNodeProps(any.getLeader())));
}
}
@@ -418,7 +418,7 @@ public class DistributedUpdateProcessor
int hash = compositeIdRouter.sliceHash(id, doc, null, coll);
for (DocRouter.Range range : ranges) {
if (range.includes(hash)) {
- if (nodes == null) nodes = new ArrayList<Node>();
+ if (nodes == null) nodes = new ArrayList<>();
DocCollection targetColl = cstate.getCollection(rule.getTargetCollectionName());
Collection<Slice> activeSlices = targetColl.getRouter().getSearchSlicesSingle(id, null, targetColl);
if (activeSlices == null || activeSlices.isEmpty()) {
@@ -526,7 +526,7 @@ public class DistributedUpdateProcessor
.getReplicaProps(collection, shardId, leaderReplica.getName(),
req.getCore().getName());
if (replicaProps != null) {
- nodes = new ArrayList<Node>(replicaProps.size());
+ nodes = new ArrayList<>(replicaProps.size());
for (ZkCoreNodeProps props : replicaProps) {
nodes.add(new StdNode(props));
}
@@ -1100,7 +1100,7 @@ public class DistributedUpdateProcessor
if(route == null) route = params.get(ShardParams.SHARD_KEYS);// deprecated . kept for backcompat
Collection<Slice> slices = coll.getRouter().getSearchSlices(route, params, coll);
- List<Node> leaders = new ArrayList<Node>(slices.size());
+ List<Node> leaders = new ArrayList<>(slices.size());
for (Slice slice : slices) {
String sliceName = slice.getName();
Replica leader;
@@ -1224,7 +1224,7 @@ public class DistributedUpdateProcessor
.getReplicaProps(collection, myShardId, leaderReplica.getName(),
req.getCore().getName(), null, ZkStateReader.DOWN);
if (replicaProps != null) {
- List<Node> myReplicas = new ArrayList<Node>();
+ List<Node> myReplicas = new ArrayList<>();
for (ZkCoreNodeProps replicaProp : replicaProps) {
myReplicas.add(new StdNode(replicaProp));
}
@@ -1479,7 +1479,7 @@ public class DistributedUpdateProcessor
private List<Node> getCollectionUrls(SolrQueryRequest req, String collection) {
ClusterState clusterState = req.getCore().getCoreDescriptor()
.getCoreContainer().getZkController().getClusterState();
- List<Node> urls = new ArrayList<Node>();
+ List<Node> urls = new ArrayList<>();
Map<String,Slice> slices = clusterState.getSlicesMap(collection);
if (slices == null) {
throw new ZooKeeperException(ErrorCode.BAD_REQUEST,
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java Wed Mar 12 14:39:17 2014
@@ -84,7 +84,7 @@ public abstract class FieldMutatingUpdat
// make a copy we can iterate over while mutating the doc
final Collection<String> fieldNames
- = new ArrayList<String>(doc.getFieldNames());
+ = new ArrayList<>(doc.getFieldNames());
for (final String fname : fieldNames) {
@@ -217,7 +217,7 @@ public abstract class FieldMutatingUpdat
this.core = core;
this.params = params;
- final Collection<Class> classes = new ArrayList<Class>(params.typeClass.size());
+ final Collection<Class> classes = new ArrayList<>(params.typeClass.size());
for (String t : params.typeClass) {
try {