com.hazelcast.mapreduce.aggregation.impl
Class AcceptAllSupplier<KeyIn,ValueIn,ValueOut>

java.lang.Object
  extended by com.hazelcast.mapreduce.aggregation.Supplier<KeyIn,ValueIn,ValueOut>
      extended by com.hazelcast.mapreduce.aggregation.impl.AcceptAllSupplier<KeyIn,ValueIn,ValueOut>
Type Parameters:
KeyIn - the input key type
ValueIn - the input value type
ValueOut - the output value type
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable, Serializable

public class AcceptAllSupplier<KeyIn,ValueIn,ValueOut>
extends Supplier<KeyIn,ValueIn,ValueOut>
implements IdentifiedDataSerializable

A standard implementation of the Supplier interface which accepts all input values and may apply a given PropertyExtractor on those.

See Also:
Serialized Form

Constructor Summary
AcceptAllSupplier(PropertyExtractor<ValueIn,ValueOut> propertyExtractor)
           
 
Method Summary
 ValueOut apply(Map.Entry<KeyIn,ValueIn> entry)
          The apply method is used to apply the actual filtering or extraction / transformation to the input entry.
If the input value should be ignored by the aggregation, the Supplier has to return
 int getFactoryId()
          Returns DataSerializableFactory factory id for this class.
 int getId()
          Returns type identifier for this class.
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class com.hazelcast.mapreduce.aggregation.Supplier
all, all, fromKeyPredicate, fromKeyPredicate, fromPredicate, fromPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptAllSupplier

public AcceptAllSupplier(PropertyExtractor<ValueIn,ValueOut> propertyExtractor)
Method Detail

apply

public ValueOut apply(Map.Entry<KeyIn,ValueIn> entry)
Description copied from class: Supplier
The apply method is used to apply the actual filtering or extraction / transformation to the input entry.
If the input value should be ignored by the aggregation, the Supplier has to return
null
as the supplied value, therefor
null
is not a legal value itself!
All custom suppliers have to be serializable, if they hold internal state remember that the same supplier instance might be used from multiple threads concurrently.

Specified by:
apply in class Supplier<KeyIn,ValueIn,ValueOut>
Parameters:
entry - the entry key-value pair to supply to the aggregation
Returns:
the supplied value or null if value should be ignored

getFactoryId

public int getFactoryId()
Description copied from interface: IdentifiedDataSerializable
Returns DataSerializableFactory factory id for this class.

Specified by:
getFactoryId in interface IdentifiedDataSerializable
Returns:
factory id

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Specified by:
getId in interface IdentifiedDataSerializable
Returns:
type id

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.