Package com.facebook.stats

Examples of com.facebook.stats.QuantileDigest$Node


    TimestampContainer timestamp;
    OsmUser user;
    long changesetId;
    double latitude;
    double longitude;
    Node node;
   
    id = Long.parseLong(reader.getAttributeValue(null, ATTRIBUTE_NAME_ID));
    version = Integer.parseInt(reader.getAttributeValue(null, ATTRIBUTE_NAME_VERSION));
    timestamp = parseTimestamp(reader.getAttributeValue(null, ATTRIBUTE_NAME_TIMESTAMP));
    changesetId = Long.parseLong(reader.getAttributeValue(null, ATTRIBUTE_NAME_CHANGESET_ID));
    user = readUser();
    changesetId = readChangesetId();
    latitude = Double.parseDouble(reader.getAttributeValue(null, ATTRIBUTE_NAME_LATITUDE));
    longitude = Double.parseDouble(reader.getAttributeValue(null, ATTRIBUTE_NAME_LONGITUDE));
   
    node = new Node(new CommonEntityData(id, version, timestamp, user, changesetId), latitude, longitude);
   
    reader.nextTag();
    while (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
      if (reader.getLocalName().equals(ELEMENT_NAME_TAG)) {
        node.getTags().add(readTag());
      } else {
        readUnknownElement();
      }
    }
   
View Full Code Here


  @Test
  public void computeBoundNoUpstreamBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
    bc.complete();
    bc.release();

    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
    Assert.assertEquals(new Bound(2, 1, 2, 1, "NewBound"), ec.getEntity());
View Full Code Here

  @Test
  public void computeBoundWithUpstreamBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
    bc.complete();
    bc.release();

    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
    EntityContainer ec = iterator.next();
View Full Code Here

 
  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer nodeContainer) {
    Node node;
   
    node = nodeContainer.getEntity();
   
    nodeWriter.writeField(node.getId());
    nodeWriter.writeField(node.getVersion());
    nodeWriter.writeField(node.getUser().getId());
    nodeWriter.writeField(node.getTimestamp());
    nodeWriter.writeField(node.getChangesetId());
    nodeWriter.writeField(buildTags(node));
    nodeWriter.writeField(pointBuilder.createPoint(node.getLatitude(), node.getLongitude()));
    nodeWriter.endRecord();
   
    if (enableBboxBuilder || enableLinestringBuilder) {
      wayGeometryBuilder.addNodeLocation(node);
    }
View Full Code Here

   */
  @Override
  public void process(CommonEntityData data, ResultSet resultSet) throws SQLException {
    double latitude;
    double longitude;
    Node node;
   
    latitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("latitude"));
        longitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("longitude"));
   
        node = new Node(data, latitude, longitude);
       
        listener.process(node, resultSet);
  }
View Full Code Here

  public void removeExistingBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  @Test
  public void removeNoBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
View Full Code Here

  public void setNewBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer container) {
    Node node = container.getEntity();

    boolean matchesFilter = false;
    for (Tag tag : node.getTags()) {
      if (allowedKeys.contains(tag.getKey())) {
        matchesFilter = true;
        break;
      }
    }
View Full Code Here

TOP

Related Classes of com.facebook.stats.QuantileDigest$Node

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.