public class RetainMostRecentUpdateConflictResolver extends Object implements UpdateConflictResolver, org.apache.hadoop.conf.Configurable
Modifier and Type | Field and Description |
---|---|
static String |
COUNTER_GROUP |
static String |
DUPLICATES_COUNTER_NAME |
static String |
ORDER_BY_FIELD_NAME_DEFAULT |
static String |
ORDER_BY_FIELD_NAME_KEY |
static String |
OUTDATED_COUNTER_NAME |
Constructor and Description |
---|
RetainMostRecentUpdateConflictResolver() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf() |
protected Iterator<SolrInputDocument> |
getMaximum(Iterator<SolrInputDocument> updates,
String fieldName,
Comparator child,
org.apache.hadoop.mapreduce.Reducer.Context context)
Returns the most recent document among the colliding updates
|
protected String |
getOrderByFieldName() |
Iterator<SolrInputDocument> |
orderUpdates(org.apache.hadoop.io.Text key,
Iterator<SolrInputDocument> updates,
org.apache.hadoop.mapreduce.Reducer.Context ctx)
Given a list of all colliding document updates for the same unique document
key, this method returns zero or more documents in an application specific
order.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
public static final String ORDER_BY_FIELD_NAME_KEY
public static final String ORDER_BY_FIELD_NAME_DEFAULT
public static final String COUNTER_GROUP
public static final String DUPLICATES_COUNTER_NAME
public static final String OUTDATED_COUNTER_NAME
public RetainMostRecentUpdateConflictResolver()
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
protected String getOrderByFieldName()
public Iterator<SolrInputDocument> orderUpdates(org.apache.hadoop.io.Text key, Iterator<SolrInputDocument> updates, org.apache.hadoop.mapreduce.Reducer.Context ctx)
UpdateConflictResolver
orderUpdates
in interface UpdateConflictResolver
key
- the document key common to all collidingUpdates mentioned belowupdates
- all updates in the MapReduce job that have a key equal to
uniqueKey
mentioned above. The input order is unspecified.ctx
- The Context
passed from the Reducer
implementations.protected Iterator<SolrInputDocument> getMaximum(Iterator<SolrInputDocument> updates, String fieldName, Comparator child, org.apache.hadoop.mapreduce.Reducer.Context context)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.