Exemplo n.º 1
0
  @Override
  public void check(final Node node) {

    // Store snapshot from last check
    if (stateMachine.getLastNode() != null) {
      history.store(
          stateMachine.getLastNode(), currentGroupify, stateMachine.getLastTransition().snapshot);
    }

    // Transition
    final Transition transition = stateMachine.transition(node);

    // Switch groupifies
    final IHashGroupify temp = lastGroupify;
    lastGroupify = currentGroupify;
    currentGroupify = temp;
    currentGroupify.clear();

    // Apply transition
    switch (transition.type) {
      case UNOPTIMIZED:
        currentGroupify =
            transformer.apply(transition.projection, node.getTransformation(), currentGroupify);
        break;
      case ROLLUP:
        currentGroupify =
            transformer.applyRollup(
                transition.projection, node.getTransformation(), lastGroupify, currentGroupify);
        break;
      case SNAPSHOT:
        currentGroupify =
            transformer.applySnapshot(
                transition.projection,
                node.getTransformation(),
                currentGroupify,
                transition.snapshot);
        break;
    }

    // Mark as checked
    node.setChecked();

    // Propagate k-anonymity
    node.setKAnonymous(currentGroupify.isKAnonymous());

    // Propagate anonymity and information loss
    if (currentGroupify.isAnonymous()) {
      node.setAnonymous(true);
      metric.evaluate(node, currentGroupify);
    } else {
      node.setInformationLoss(null);
      node.setAnonymous(false);
    }
  }
Exemplo n.º 2
0
  @Override
  @Deprecated
  public Data transform(final Node node) {

    // Apply transition and groupify
    currentGroupify.clear();
    currentGroupify = transformer.apply(0L, node.getTransformation(), currentGroupify);

    // Determine outliers and set infoloss
    if (!node.isChecked()) {
      node.setChecked();
      node.setAnonymous(currentGroupify.isAnonymous());
      metric.evaluate(node, currentGroupify);
      node.setTagged();
    }

    return getBuffer();
  }
Exemplo n.º 3
0
  @Override
  public Data transformAndMarkOutliers(final Node node) {

    // Apply transition and groupify
    currentGroupify.clear();
    currentGroupify = transformer.apply(0L, node.getTransformation(), currentGroupify);

    // Determine outliers and set infoloss
    node.setAnonymous(currentGroupify.isAnonymous());
    if (!node.isChecked()) {
      node.setChecked();
      metric.evaluate(node, currentGroupify);
      node.setTagged();
    }

    // Find outliers
    if (config.getAbsoluteMaxOutliers() != 0) {
      currentGroupify.markOutliers(transformer.getBuffer());
    }

    // Return the buffer
    return getBuffer();
  }