Package com.aamend.hadoop.clustering.cluster

Examples of com.aamend.hadoop.clustering.cluster.CanopyWritable


                    newCluster = new Canopy(canopy.getId(), point, 0L);
                    LOGGER.debug("Adding (T1) {} to Cluster {}", Arrays.toString(point),
                            Arrays.toString(canopy.getCenter()));
                }

                context.write(KEY, new CanopyWritable(newCluster));
            }

            stronglyBound = stronglyBound || dist < t2;
        }
        if (!stronglyBound) {
View Full Code Here


                } else {
                    newCluster = new Canopy(canopy.getId(), point, 0L);
                    LOGGER.debug("Adding (T1) {} to Cluster center {}", Arrays.toString((int[]) value.get()),
                            Arrays.toString(canopy.getCenter()));
                }
                context.write(KEY, new CanopyWritable(newCluster));
            }
            stronglyBound = stronglyBound || dist < t2;
        }
        if (!stronglyBound) {
            nextCanopyId++;
            Cluster canopy = new Canopy(nextCanopyId, point, 1L);
            LOGGER.debug("Creating a new Cluster {}", canopy.asFormattedString());
            canopies.add(canopy);
            KEY.set(Arrays.toString(canopy.getCenter()));
            context.write(KEY, new CanopyWritable(canopy));
        }

    }
View Full Code Here

        clusterTemplate.computeCenter(points, measure);
        nextCanopyId++;
        Cluster newCluster = new Canopy(nextCanopyId, clusterTemplate.getCenter(), clusterTemplate.getNum());
        context.getCounter(COUNTER, COUNTER_CANOPY).increment(1L);
        context.write(KEY, new CanopyWritable(newCluster));

    }
View Full Code Here

                // Read canopies
                SequenceFile.Reader reader = new SequenceFile.Reader(conf,
                        SequenceFile.Reader.file(new Path(uri)));
                WritableComparable key = (WritableComparable) ReflectionUtils
                        .newInstance(reader.getKeyClass(), conf);
                CanopyWritable value =
                        (CanopyWritable) ReflectionUtils
                                .newInstance(reader.getValueClass(), conf);

                int i = 0;
                while (reader.next(key, value)) {
                    i++;
                    Cluster cluster = value.get();
                    clusters.add(cluster);
                }

                IOUtils.closeStream(reader);
            }
View Full Code Here

TOP

Related Classes of com.aamend.hadoop.clustering.cluster.CanopyWritable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.