@Override
    public boolean nextKeyValue() throws IOException, InterruptedException {
        // filter the <key, value> pairs
        do {
            if (!this.sequenceFileRecordReader.nextKeyValue()) {
                return false;
            }
            // update <key, value>
            key = this.sequenceFileRecordReader.getCurrentKey();
            value = this.sequenceFileRecordReader.getCurrentValue();
            long pointArray[] = Serializer.deserialize(fromDimensionLengths,
                    new BigInteger(key.toString()));
            List<Long> point = new ArrayList<Long>();
            for (long l : pointArray) {
                point.add(l);
            }
            try {
                PointValidation.validate(point, startPointForElement,
                        endPointForElement);
            } catch (SizeNotEqualException e) {
                e.printStackTrace();
                // TODO exit is not a good way
                System.exit(-1);
            } catch (InvalidPointException e) {
                // if current <key, value> is not valid, continue the loop to
                // get the next <key, value>
                continue;
            }
            // no exceptions caught, the <key, value> is valid, return
            // immediately;
            return true;
        } while (true);
    }