Package org.hivedb

Examples of org.hivedb.HiveRuntimeException


  public void run() {
    try {
      Schemas.install(new HiveConfigurationSchema(), uri);
      new HiveSemaphoreDao(CachingDataSourceProvider.getInstance().getDataSource(uri)).create();
    } catch (Exception e) {
      throw new HiveRuntimeException(e.getMessage(), e);
    }
  }
View Full Code Here


        //Tickle driver
        Class.forName("com.mysql.jdbc.Driver");
        @SuppressWarnings("unused")
        Connection conn = DriverManager.getConnection(getConnectString(argMap));
      } catch (Exception e) {
        throw new HiveRuntimeException(e.getMessage());
      }
      System.out.println(getConnectString(argMap));
      new HiveConfigurationSchemaCommandLineInstaller(getConnectString(argMap)).run();
    }
  }
View Full Code Here

  public void run() {
    try {
      new HiveConfigurationSchema(uri).install();
      new HiveSemaphoreDao(CachingDataSourceProvider.getInstance().getDataSource(uri)).create();
    } catch (Exception e) {
      throw new HiveRuntimeException(e.getMessage(), e);
    }
  }
View Full Code Here

        //Tickle driver
        Class.forName("com.mysql.jdbc.Driver");
        @SuppressWarnings("unused")
        Connection conn = DriverManager.getConnection(getConnectString(argMap));
      } catch (Exception e) {
        throw new HiveRuntimeException(e.getMessage());
      }
      System.out.println(getConnectString(argMap));
      new HiveConfigurationSchemaInstaller(getConnectString(argMap)).run();
    }
  }
View Full Code Here

    if (ReflectionTools.doesRealSetterExist(ReflectionTools.getGetterOfProperty(instance.getClass(), property)))
      ReflectionTools.invokeSetter(instance, property, value);
    else if (instance instanceof PropertyAccessor)
      ((PropertyAccessor)instance).set(property, value);
    else
      throw new HiveRuntimeException(String.format("No way to inoke setter of class %s, property %s", instance.getClass(), property));
  }
View Full Code Here

      new PreparedStatementCreatorFactory(insertSql(),getTypes());
    creatorFactory.setReturnGeneratedKeys(true);
   
    int rows = j.update(creatorFactory.newPreparedStatementCreator(getParameters(newObject)), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to create Resource: "
          + getParameters(newObject));
    if (generatedKey.getKeyList().size() == 0)
      throw new HiveRuntimeException("Unable to retrieve generated primary key");
   
    newObject.updateId(generatedKey.getKey().intValue());
   
    return newObject; 
  }
View Full Code Here

   
    PreparedStatementCreatorFactory creatorFactory = new PreparedStatementCreatorFactory(updateSql(),types);
   
    int rows = j.update(creatorFactory.newPreparedStatementCreator(params));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to update node with id: " + node.getId());
   
    return node;
  }
View Full Code Here

        "DELETE from node_metadata where id=?",
        new int[] { Types.INTEGER });
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to delete node for id: " + node.getId());
    return node;
  }
View Full Code Here

          Transform.map(new Unary<Object, String>() {
            public String f(Object item) {
              return item != null ? config.getId(item).toString() : "null";
            }
          }, collection));
      throw new HiveRuntimeException(String.format("Encountered null items in collection: %s", ids));
    }
  }
View Full Code Here

    directory.deletePrimaryIndexKey(primaryIndexKey);
  }

  public void deleteResourceId(String resource, Object id) throws HiveLockableException {
    if (getResource(resource).isPartitioningResource())
      throw new HiveRuntimeException(String.format("Attempt to delete a resource id of resource %s, which is a partitioning dimension. It can only be deleted as a primary index key", id));
    Preconditions.isWritable(directory.getKeySemaphoresOfResourceId(getResource(resource), id), semaphore);
    directory.deleteResourceId(getResource(resource), id);
  }
View Full Code Here

TOP

Related Classes of org.hivedb.HiveRuntimeException

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.