Module pygw.statistics.field.bloom_filter_statistic
Source code
#
# Copyright (c) 2013-2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 which accompanies this distribution and is
# available at http://www.apache.org/licenses/LICENSE-2.0.txt
# ===============================================================================================
from pygw.base import GeoWaveObject
from pygw.config import geowave_pkg
from ..statistic import FieldStatistic
from ..statistic_type import FieldStatisticType
from ...base.java_transformer import JavaTransformer
class BloomFilterStatistic(FieldStatistic):
"""
Applies a bloom filter to field values useful for quickly determining set membership. False positives are possible
but false negatives are not possible. In other words, a value can be determined to be possibly in the set or
definitely not in the set.
"""
STATS_TYPE = FieldStatisticType(geowave_pkg.core.store.statistics.field.BloomFilterStatistic.STATS_TYPE)
def __init__(self, type_name=None, field_name=None, java_ref=None):
if java_ref is None:
if type_name is None and field_name is None:
java_ref = geowave_pkg.core.store.statistics.field.BloomFilterStatistic()
else:
java_ref = geowave_pkg.core.store.statistics.field.BloomFilterStatistic(type_name, field_name)
super().__init__(java_ref, BloomFilterTransformer())
def set_expected_insertions(self, expected_insertions):
self._java_ref.setExpectedInsertions(int(expected_insertions))
def get_expected_insertions(self):
return self._java_ref.getExpectedInsertions()
def set_desired_false_positive_probability(self, probability):
self._java_ref.setDesiredFalsePositiveProbability(float(probability))
def get_desired_false_positive_probability(self):
return self._java_ref.getDesiredFalsePositiveProbability()
class BloomFilterTransformer(JavaTransformer):
def transform(self, j_object):
return BloomFilter(j_object)
class BloomFilter(GeoWaveObject):
def might_contain(self, value):
return self._java_ref.mightContain(value)
def expected_fpp(self):
return self._java_ref.expectedFpp()
def approximate_element_count(self):
return self._java_ref.approximateElementCount()
Classes
class BloomFilter (java_ref)
-
Base Class for pygw objects that wrap Java objects.
Source code
class BloomFilter(GeoWaveObject): def might_contain(self, value): return self._java_ref.mightContain(value) def expected_fpp(self): return self._java_ref.expectedFpp() def approximate_element_count(self): return self._java_ref.approximateElementCount()
Ancestors
Methods
def approximate_element_count(self)
-
Source code
def approximate_element_count(self): return self._java_ref.approximateElementCount()
def expected_fpp(self)
-
Source code
def expected_fpp(self): return self._java_ref.expectedFpp()
def might_contain(self, value)
-
Source code
def might_contain(self, value): return self._java_ref.mightContain(value)
Inherited members
class BloomFilterStatistic (type_name=None, field_name=None, java_ref=None)
-
Applies a bloom filter to field values useful for quickly determining set membership. False positives are possible but false negatives are not possible. In other words, a value can be determined to be possibly in the set or definitely not in the set.
Source code
class BloomFilterStatistic(FieldStatistic): """ Applies a bloom filter to field values useful for quickly determining set membership. False positives are possible but false negatives are not possible. In other words, a value can be determined to be possibly in the set or definitely not in the set. """ STATS_TYPE = FieldStatisticType(geowave_pkg.core.store.statistics.field.BloomFilterStatistic.STATS_TYPE) def __init__(self, type_name=None, field_name=None, java_ref=None): if java_ref is None: if type_name is None and field_name is None: java_ref = geowave_pkg.core.store.statistics.field.BloomFilterStatistic() else: java_ref = geowave_pkg.core.store.statistics.field.BloomFilterStatistic(type_name, field_name) super().__init__(java_ref, BloomFilterTransformer()) def set_expected_insertions(self, expected_insertions): self._java_ref.setExpectedInsertions(int(expected_insertions)) def get_expected_insertions(self): return self._java_ref.getExpectedInsertions() def set_desired_false_positive_probability(self, probability): self._java_ref.setDesiredFalsePositiveProbability(float(probability)) def get_desired_false_positive_probability(self): return self._java_ref.getDesiredFalsePositiveProbability()
Ancestors
Class variables
var STATS_TYPE
Methods
def get_desired_false_positive_probability(self)
-
Source code
def get_desired_false_positive_probability(self): return self._java_ref.getDesiredFalsePositiveProbability()
def get_expected_insertions(self)
-
Source code
def get_expected_insertions(self): return self._java_ref.getExpectedInsertions()
def set_desired_false_positive_probability(self, probability)
-
Source code
def set_desired_false_positive_probability(self, probability): self._java_ref.setDesiredFalsePositiveProbability(float(probability))
def set_expected_insertions(self, expected_insertions)
-
Source code
def set_expected_insertions(self, expected_insertions): self._java_ref.setExpectedInsertions(int(expected_insertions))
Inherited members
class BloomFilterTransformer (*args, **kwargs)
-
Base class for transforming Java objects to an appropriate Python counterpart. All extending classes should overwrite the
transform
method to perform the transformation.Source code
class BloomFilterTransformer(JavaTransformer): def transform(self, j_object): return BloomFilter(j_object)
Ancestors
Inherited members