Exemplo n.º 1
0
  /**
   * Open a b-tree controller.
   *
   * @see Conglomerate#open
   * @exception StandardException Standard exception policy.
   */
  public ConglomerateController open(
      TransactionManager xact_manager,
      Transaction rawtran,
      boolean hold,
      int open_mode,
      int lock_level,
      LockingPolicy locking_policy,
      StaticCompiledOpenConglomInfo static_info,
      DynamicCompiledOpenConglomInfo dynamic_info)
      throws StandardException {
    // Create a new b-tree secondary index controller.
    B2IController b2ic = new B2IController();

    // Do the actual open of the container in the super class.
    b2ic.init(
        xact_manager, // current transaction
        rawtran, // current raw store transaction
        hold, // holdability
        open_mode,
        lock_level,
        locking_policy,
        true,
        this,
        new B2IUndo(),
        (B2IStaticCompiledInfo) static_info,
        dynamic_info);

    // Return it to the caller.
    return b2ic;
  }
Exemplo n.º 2
0
  public void compressConglomerate(TransactionManager xact_manager, Transaction rawtran)
      throws StandardException {
    B2IController b2ic = new B2IController();

    try {
      int open_mode = TransactionController.OPENMODE_FORUPDATE;

      // Do the actual open of the container in the super class.
      b2ic.init(
          xact_manager, // current transaction
          xact_manager.getRawStoreXact(), // current raw store xact
          false, // Not holdable
          open_mode,
          TransactionController.MODE_TABLE,
          xact_manager
              .getRawStoreXact()
              .newLockingPolicy(
                  LockingPolicy.MODE_CONTAINER, TransactionController.ISOLATION_SERIALIZABLE, true),
          true,
          this,
          new B2IUndo(),
          (B2IStaticCompiledInfo) null,
          (DynamicCompiledOpenConglomInfo) null);

      b2ic.getContainer().compressContainer();

    } finally {
      b2ic.close();
    }

    return;
  }
Exemplo n.º 3
0
  /**
   * Bulk Load a B-tree secondary index.
   *
   * @see Conglomerate#load
   * @exception StandardException Standard Derby Error policy. raise
   *     SQLState.STORE_CONGLOMERATE_DUPLICATE_KEY_EXCEPTION if a duplicate key is detected in the
   *     load.
   */
  public long load(
      TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource)
      throws StandardException {
    long num_rows_loaded = 0;
    B2IController b2ic = new B2IController();

    try {
      int open_mode = TransactionController.OPENMODE_FORUPDATE;

      if (createConglom) {
        open_mode |= (ContainerHandle.MODE_UNLOGGED | ContainerHandle.MODE_CREATE_UNLOGGED);
      }

      // Do the actual open of the container in the super class.
      b2ic.init(
          xact_manager, // current transaction
          xact_manager.getRawStoreXact(), // current raw store xact
          false, // Not holdable
          open_mode,
          TransactionController.MODE_TABLE,
          xact_manager
              .getRawStoreXact()
              .newLockingPolicy(
                  LockingPolicy.MODE_CONTAINER, TransactionController.ISOLATION_SERIALIZABLE, true),
          true,
          this,
          new B2IUndo(),
          (B2IStaticCompiledInfo) null,
          (DynamicCompiledOpenConglomInfo) null);

      num_rows_loaded = b2ic.load(xact_manager, createConglom, rowSource);

    } finally {
      b2ic.close();
    }

    return (num_rows_loaded);
  }