Package org.kitesdk.data

Examples of org.kitesdk.data.DatasetIOException


        get = getModifier.modifyGet(get);
      }
      try {
        return table.get(get);
      } catch (IOException e) {
        throw new DatasetIOException("Error performing get", e);
      }
    } finally {
      if (table != null) {
        try {
          table.close();
        } catch (IOException e) {
          throw new DatasetIOException("Error putting table back into pool", e);
        }
      }
    }
  }
View Full Code Here


    } finally {
      if (table != null) {
        try {
          table.close();
        } catch (IOException e) {
          throw new DatasetIOException("Error putting table back into pool", e);
        }
      }
    }
  }
View Full Code Here

      }
      try {
        return table.checkAndPut(put.getRow(), Constants.SYS_COL_FAMILY,
            Constants.VERSION_CHECK_COL_QUALIFIER, versionBytes, put);
      } catch (IOException e) {
        throw new DatasetIOException(
            "Error putting row from table with checkAndPut", e);
      }
    } else {
      try {
        table.put(put);
        return true;
      } catch (IOException e) {
        throw new DatasetIOException("Error putting row from table", e);
      }
    }
  }
View Full Code Here

    HTableInterface table = pool.getTable(tableName);
    Result result;
    try {
      result = table.increment(increment);
    } catch (IOException e) {
      throw new DatasetIOException("Error incrementing field.", e);
    }
    return entityMapper.mapFromIncrementResult(result, fieldName);

  }
View Full Code Here

        try {
          return table.checkAndDelete(delete.getRow(),
              Constants.SYS_COL_FAMILY, Constants.VERSION_CHECK_COL_QUALIFIER,
              versionBytes, delete);
        } catch (IOException e) {
          throw new DatasetIOException(
              "Error deleteing row from table with checkAndDelete", e);
        }
      } else {
        try {
          table.delete(delete);
          return true;
        } catch (IOException e) {
          throw new DatasetIOException("Error deleteing row from table", e);
        }
      }
    } finally {
      if (table != null) {
        try {
          table.close();
        } catch (IOException e) {
          throw new DatasetIOException("Error putting table back into pool", e);
        }
      }
    }
  }
View Full Code Here

    this.conf = conf;
    try {
      this.fs = FileSystem.get(conf);
    } catch (IOException ex) {
      throw new DatasetIOException("Could not get default FileSystem", ex);
    }
  }
View Full Code Here

    } catch (JsonParseException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (JsonMappingException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (IOException e) {
      throw new DatasetIOException("Cannot initialize JSON parser", e);
    }
  }
View Full Code Here

    } catch (JsonParseException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (JsonMappingException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (IOException e) {
      throw new DatasetIOException("Cannot initialize JSON parser", e);
    }
  }
View Full Code Here

    } catch (JsonParseException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (JsonMappingException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (IOException e) {
      throw new DatasetIOException("Cannot initialize JSON parser", e);
    }
  }
View Full Code Here

      case STRING:
        // TODO: could be null
        try {
          return URLEncoder.encode(value.toString(), "UTF-8");
        } catch (UnsupportedEncodingException e) {
          throw new DatasetIOException("Failed to encode value: " + value, e);
        }
      default:
        // otherwise, encode as Avro binary and then base64
        DatumWriter writer = ReflectData.get().createDatumWriter(schema);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(out, null);
        try {
          writer.write(value, encoder);
          encoder.flush();
        } catch (IOException e) {
          throw new DatasetIOException("Cannot encode Avro value", e);
        }
        return Base64.encodeBase64URLSafeString(out.toByteArray());
    }
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.DatasetIOException

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.