Package org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser

Examples of org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.BadTsvLineException


          tabOffsets.add(i);
        }
      }
      tabOffsets.add(length);
      if (tabOffsets.size() > families.length) {
        throw new BadTsvLineException("Bad line:\n");
      }

      return new ParsedLine(tabOffsets, lineBytes);
    }
View Full Code Here


        if (lineBytes[i] == separatorByte) {
          tabOffsets.add(i);
        }
      }
      if (tabOffsets.isEmpty()) {
        throw new BadTsvLineException("No delimiter");
      }

      tabOffsets.add(length);

      if (tabOffsets.size() > families.length) {
        throw new BadTsvLineException("Excessive columns");
      } else if (tabOffsets.size() <= getRowKeyColumnIndex()) {
        throw new BadTsvLineException("No row key");
      }
      return new ParsedLine(tabOffsets, lineBytes);
    }
View Full Code Here

    if (parsed.getIndividualAttributes() != null) {
      String[] attributes = parsed.getIndividualAttributes();
      for (String attr : attributes) {
        String[] split = attr.split(ImportTsv.DEFAULT_ATTRIBUTES_SEPERATOR);
        if (split == null || split.length <= 1) {
          throw new BadTsvLineException("Invalid attributes seperator specified" + attributes);
        } else {
          if (split[0].length() <= 0 || split[1].length() <= 0) {
            throw new BadTsvLineException("Invalid attributes seperator specified" + attributes);
          }
          put.setAttribute(split[0], Bytes.toBytes(split[1]));
        }
      }
    }
View Full Code Here

    if (parsed.getIndividualAttributes() != null) {
      String[] attributes = parsed.getIndividualAttributes();
      for (String attr : attributes) {
        String[] split = attr.split(ImportTsv.DEFAULT_ATTRIBUTES_SEPERATOR);
        if (split == null || split.length <= 1) {
          throw new BadTsvLineException("Invalid attributes seperator specified" + attributes);
        } else {
          if (split[0].length() <= 0 || split[1].length() <= 0) {
            throw new BadTsvLineException("Invalid attributes seperator specified" + attributes);
          }
          put.setAttribute(split[0], Bytes.toBytes(split[1]));
        }
      }
    }
View Full Code Here

      BadTsvLineException {
    ExpressionNode node = null;
    try {
      node = parser.parse(visibilityLabelsExp);
    } catch (ParseException e) {
      throw new BadTsvLineException(e.getMessage());
    }
    node = expander.expand(node);
    List<Tag> tags = new ArrayList<Tag>();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
View Full Code Here

          labelOrdinal = this.labels.get(identifier);
          labelOrdinal = -1 * labelOrdinal; // Store NOT node as -ve ordinal.
        }
      }
      if (labelOrdinal == 0) {
        throw new BadTsvLineException("Invalid visibility label " + identifier);
      }
      WritableUtils.writeVInt(dos, labelOrdinal);
    } else {
      List<ExpressionNode> childExps = ((NonLeafExpressionNode) node).getChildExps();
      for (ExpressionNode child : childExps) {
View Full Code Here

        List<Tag> visibilityTags = createVisibilityTags(cellVisibilityExpr);
        kv = new KeyValue(lineBytes, rowKeyOffset, rowKeyLength, family, familyOffset,
            familyLength, qualifier, qualifierOffset, qualifierLength, ts, KeyValue.Type.Put,
            lineBytes, columnOffset, columnLength, visibilityTags);
      } catch (ParseException e) {
        throw new BadTsvLineException("Parse Exception " + e.getMessage());
      }
    } else {
      kv = new KeyValue(lineBytes, rowKeyOffset, rowKeyLength, family, familyOffset, familyLength,
          qualifier, qualifierOffset, qualifierLength, ts, KeyValue.Type.Put, lineBytes, columnOffset,
          columnLength);
View Full Code Here

        if (lineBytes[i] == separatorByte) {
          tabOffsets.add(i);
        }
      }
      if (tabOffsets.isEmpty()) {
        throw new BadTsvLineException("No delimiter");
      }

      tabOffsets.add(length);

      if (tabOffsets.size() > families.length) {
        throw new BadTsvLineException("Excessive columns");
      } else if (tabOffsets.size() <= getRowKeyColumnIndex()) {
        throw new BadTsvLineException("No row key");
      }
      return new ParsedLine(tabOffsets, lineBytes);
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.BadTsvLineException

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.