org.eclipse.jgit.storage.dht.spi.cache
Class Namespace

java.lang.Object
  extended by org.eclipse.jgit.storage.dht.spi.cache.Namespace

public class Namespace
extends java.lang.Object

Defines a space within the cache cluster.


Field Summary
static Namespace CACHED_PACK
          Namespace used by the cached pack information.
static Namespace CHUNK
          Namespace used by the ChunkTable.
static Namespace CHUNK_META
          Namespace used by the ChunkTable for meta field only.
static Namespace OBJECT_INDEX
          Namespace used by the ObjectIndexTable.
static Namespace REPOSITORY_INDEX
          Namespace used by the RepositoryIndexTable.
 
Method Summary
static Namespace create(byte[] name)
          Create a namespace from a byte array.
static Namespace create(java.lang.String name)
          Create a namespace from a string name.
 boolean equals(java.lang.Object other)
           
 byte[] getBytes()
           
 int hashCode()
           
 CacheKey key(byte[] key)
          Construct a MemKey within this namespace.
 CacheKey key(RowKey key)
          Construct a MemKey within this namespace.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CHUNK

public static final Namespace CHUNK
Namespace used by the ChunkTable.


CHUNK_META

public static final Namespace CHUNK_META
Namespace used by the ChunkTable for meta field only.


OBJECT_INDEX

public static final Namespace OBJECT_INDEX
Namespace used by the ObjectIndexTable.


REPOSITORY_INDEX

public static final Namespace REPOSITORY_INDEX
Namespace used by the RepositoryIndexTable.


CACHED_PACK

public static final Namespace CACHED_PACK
Namespace used by the cached pack information.

Method Detail

create

public static Namespace create(java.lang.String name)
Create a namespace from a string name.

Parameters:
name - the name to wrap.
Returns:
the namespace.

create

public static Namespace create(byte[] name)
Create a namespace from a byte array.

Parameters:
name - the name to wrap.
Returns:
the namespace.

getBytes

public byte[] getBytes()
Returns:
this namespace, encoded in UTF-8.

key

public CacheKey key(byte[] key)
Construct a MemKey within this namespace.

Parameters:
key - the key to include.
Returns:
key within this namespace.

key

public CacheKey key(RowKey key)
Construct a MemKey within this namespace.

Parameters:
key - the key to include.
Returns:
key within this namespace.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.