Package org.apache.derby.iapi.store.raw

Examples of org.apache.derby.iapi.store.raw.ContainerKey


  {
    if (SanityManager.DEBUG)
      SanityManager.ASSERT(segmentId != ContainerHandle.TEMPORARY_SEGMENT,
        "Cannot recreate temp container during load tran");

    ContainerKey identity = new ContainerKey(segmentId, containerId);

    // no need to lock container during load tran
    // no need to create any page for the container, they will be created
    // as their log records are encountered later in load tran
View Full Code Here


          // a file in seg0 that we didn't expect.  Continue with the
          // next one.
          continue;
        }

        ContainerKey identity = new ContainerKey(segmentId, containerId);

        /* Not necessary to get the container thru the transaction.
         * Backup opens in container in read only mode , No need to
         * transition the transaction to active state.
         *
 
View Full Code Here

                    // that someone put a file in seg0 that we
                    // didn't expect.  Continue with the next one.
          continue;
        }

        ContainerKey ckey = new ContainerKey(segmentId,
                                                     containerId);
                oldFiles[noOldFiles++] = encryptContainer(t, ckey);
      }

            // Old versions of the container files will
View Full Code Here

    CompressedNumber.writeLong(out, pageNumber);
  }

  public static PageKey read(ObjectInput in) throws IOException
  {
    ContainerKey c = ContainerKey.read(in);
    long pn = CompressedNumber.readLong(in);

    return new PageKey(c, pn);
  }
View Full Code Here

     **/
    public void diag_detail(Properties prop)
        throws StandardException
    {
        BaseContainerHandle ch          = (BaseContainerHandle) diag_object;
        ContainerKey        key         = ch.getId();

        prop.put(RowLock.DIAG_CONTAINERID, Long.toString(key.getContainerId()));

        prop.put(RowLock.DIAG_SEGMENTID, Long.toString(key.getSegmentId()));

        // The following 2 don't make sense for container locks, just set
        // them to 0 to make it easier for now to tree container locks and
        // row locks similarly. 
        prop.put(RowLock.DIAG_PAGENUM, Integer.toString(0));
View Full Code Here

  /**
    @exception StandardException Standard Cloudscape error policy
  */
  public Cacheable setIdentity(Object key) throws StandardException {

    ContainerKey newIdentity = (ContainerKey) key;
    if (newIdentity.getSegmentId() != ContainerHandle.TEMPORARY_SEGMENT) {

      RAFContainer realContainer = new RAFContainer(dataFactory);
      return realContainer.setIdent(newIdentity);
    }

View Full Code Here

  /**
    @exception StandardException Standard Cloudscape error policy
  */
  public Cacheable createIdentity(Object key, Object createParameter) throws StandardException {

    ContainerKey newIdentity = (ContainerKey) key;

    if (newIdentity.getSegmentId() != ContainerHandle.TEMPORARY_SEGMENT) {
      RAFContainer realContainer = new RAFContainer(dataFactory);
      return realContainer.createIdentity(newIdentity, createParameter);
    }

    return createIdent(newIdentity, createParameter);
View Full Code Here

    Set container's identity
    @exception StandardException Standard Cloudscape error policy
  */
  public Cacheable setIdentity(Object key) throws StandardException {

    ContainerKey newIdentity = (ContainerKey) key;

    // if this is an open for a temp container then return an object of that type
    if (newIdentity.getSegmentId() == ContainerHandle.TEMPORARY_SEGMENT) {

      TempRAFContainer tmpContainer = new TempRAFContainer(dataFactory);
      return tmpContainer.setIdent(newIdentity);
    }

View Full Code Here

  /**
    @exception StandardException Standard Cloudscape error policy
   */
  public Cacheable createIdentity(Object key, Object createParameter) throws StandardException {

    ContainerKey newIdentity = (ContainerKey) key;

    if (newIdentity.getSegmentId() == ContainerHandle.TEMPORARY_SEGMENT) {
      TempRAFContainer tmpContainer = new TempRAFContainer(dataFactory);
      return tmpContainer.createIdent(newIdentity, createParameter);
    }

    return createIdent(newIdentity, createParameter);
View Full Code Here

      if (!(plainLock instanceof RecordHandle)) {
        // only interested in rows locks
        continue;
      }

      ContainerKey ckey = ((RecordHandle) plainLock).getContainerId();
     
      LockCount lc = (LockCount) containers.get(ckey);
      if (lc == null) {
        lc = new LockCount();
        containers.put(ckey, lc);
      }
      lc.count++;
    }

    // Determine the threshold for lock escalation
    // based upon our own limit, not the current count
    int threshold = limit / (containers.size() + 1);
    if (threshold < (limit / 4))
      threshold = limit / 4;

    // try to table lock all tables that are above
    // this threshold

    boolean didEscalate = false;
    for (Enumeration e = containers.keys(); e.hasMoreElements(); ) {
      ContainerKey ckey = (ContainerKey) e.nextElement();

      LockCount lc = (LockCount) containers.get(ckey);

      if (lc.count < threshold) {
        continue;
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.raw.ContainerKey

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.