Example usage for org.apache.hadoop.io FloatWritable get

List of usage examples for org.apache.hadoop.io FloatWritable get

Introduction

In this page you can find the example usage for org.apache.hadoop.io FloatWritable get.

Prototype

public float get() 

Source Link

Document

Return the value of this FloatWritable.

Usage

From source file:org.apache.giraph.graph.LongDoubleFloatDoubleVertex.java

License:Apache License

@Override
public final boolean addEdge(LongWritable targetId, FloatWritable edgeValue) {
    if (verticesWithEdgeValues.put(targetId.get(), edgeValue.get())) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("addEdge: Vertex=" + vertexId + ": already added an edge value for dest vertex id "
                    + targetId.get());//from   www .j av a  2  s . co m
        }
        return false;
    } else {
        return true;
    }
}

From source file:org.apache.giraph.types.FloatWritableToDoubleUnwrapper.java

License:Apache License

@Override
public Double unwrap(FloatWritable writableValue) {
    return (double) writableValue.get();
}

From source file:org.apache.giraph.types.FloatWritableToFloatUnwrapper.java

License:Apache License

@Override
public Float unwrap(FloatWritable writableValue) {
    return writableValue.get();
}

From source file:org.apache.giraph.types.ops.collections.array.WFloatArrayList.java

License:Apache License

@Override
public void addW(FloatWritable value) {
    add(value.get());
}

From source file:org.apache.giraph.types.ops.collections.array.WFloatArrayList.java

License:Apache License

@Override
public void setW(int index, FloatWritable value) {
    set(index, value.get());
}

From source file:org.apache.giraph.types.ops.collections.array.WFloatArrayList.java

License:Apache License

@Override
public void fillW(int from, int to, FloatWritable value) {
    if (to > size()) {
        throw new ArrayIndexOutOfBoundsException(
                "End index (" + to + ") is greater than array length (" + size() + ")");
    }//from ww w  .jav a2 s  .c o  m
    Arrays.fill(elements(), from, to, value.get());
}

From source file:org.apache.giraph.types.ops.FloatTypeOps.java

License:Apache License

@Override
public FloatWritable createCopy(FloatWritable from) {
    return new FloatWritable(from.get());
}

From source file:org.apache.giraph.types.ops.FloatTypeOps.java

License:Apache License

@Override
public void set(FloatWritable to, FloatWritable from) {
    to.set(from.get());
}

From source file:org.apache.impala.hive.executor.TestUdf.java

License:Apache License

public float evaluate(FloatWritable a, FloatWritable b) {
    if (a == null || b == null)
        return -1;
    return a.get() + b.get();
}

From source file:org.apache.mahout.cf.taste.hadoop.slopeone.SlopeOneDiffsToAveragesReducer.java

License:Apache License

@Override
protected void reduce(EntityEntityWritable key, Iterable<FloatWritable> values, Context context)
        throws IOException, InterruptedException {
    int count = 0;
    double total = 0.0;
    for (FloatWritable value : values) {
        total += value.get();
        count++;/* ww w .j a  va2s .  c o m*/
    }
    context.write(key, new FloatWritable((float) (total / count)));
}