Package avrobase

Examples of avrobase.AvroBaseException


        }
      }

    } catch (Exception e) {
      e.printStackTrace();
      throw new AvroBaseException(e);
    } finally {
      if (connection != null) {
        try {
          connection.close();
        } catch (SQLException e) {
View Full Code Here


      schemaTable = pool.getTable(this.schemaName);
    } catch (RuntimeException e) {
      if (e.getCause() instanceof TableNotFoundException) {
        schemaTable = createSchemaTable();
      } else {
        throw new AvroBaseException(e.getCause());
      }
    }
    try {
      loadSchemas(schemaTable);
    } catch (IOException e) {
      throw new AvroBaseException(e);
    } finally {
      pool.putTable(schemaTable);
    }
    HTableInterface table = getTable();
    try {
      if (table.getTableDescriptor().getFamily(family) == null) {
        HColumnDescriptor familyDesc = getColumnDesc(family);
        try {
          admin.disableTable(tableName);
          admin.addColumn(tableName, familyDesc);
          admin.enableTable(tableName);
        } catch (IOException e) {
          throw new AvroBaseException(e);
        }
      }
    } catch (IOException e) {
      throw new AvroBaseException(e);
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

    HTableDescriptor tableDesc = new HTableDescriptor(schemaName);
    tableDesc.addFamily(family);
    try {
      admin.createTable(tableDesc);
    } catch (IOException e1) {
      throw new AvroBaseException(e1);
    }
    schemaTable = pool.getTable(schemaName);
    return schemaTable;
  }
View Full Code Here

      if (row.length == 0 && !Bytes.equals(row, result.getRow())) {
        return null;
      }
      return getRowResult(result, row);
    } catch (IOException e) {
      throw new AvroBaseException(e);
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

          do {
            row = getNextRow(table, family);
          } while (!put(row, value, 0));
          return row;
        } catch (IOException e) {
          throw new AvroBaseException("Failed to increment column", e);
        } finally {
          pool.putTable(table);
        }
      }
      case TIMESTAMP:
View Full Code Here

      do {
        // FIXME: Spin until success, last one wins. Provably dangerous?
        version = getVersion(family, row, table);
      } while (!put(row, value, version));
    } catch (IOException e) {
      throw new AvroBaseException("Failed to retrieve version for row: " + $_(row), e);
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

      } else {
        expectedValue = Bytes.toBytes(version);
      }
      return table.checkAndPut(row, family, VERSION_COLUMN, expectedValue, put);
    } catch (IOException e) {
      throw new AvroBaseException("Could not encode " + value, e);
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

    try {
      Delete delete = new Delete(row);
      delete.deleteFamily(family);
      table.delete(delete);
    } catch (IOException e) {
      throw new AvroBaseException("Failed to delete row", e);
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

            }
          };
        }
      };
    } catch (IOException e) {
      throw new AvroBaseException(e);
    } finally {
      // FIXME: Is this safe?
      pool.putTable(table);
    }
  }
View Full Code Here

        // If not, load it up and return wrapped Row
        return new Row<T, byte[]>(readValue(dataBytes, schema, format, dataOffset, dataLength), row, version);
      }
      return null;
    } catch (IOException e) {
      throw new AvroBaseException(e);
    }
  }
View Full Code Here

TOP

Related Classes of avrobase.AvroBaseException

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.