Codota Logo
GitStore$ChunkMeta
Code IndexAdd Codota to your IDE (free)

How to use
GitStore$ChunkMeta
in
org.eclipse.jgit.generated.storage.dht.proto

Best Java code snippets using org.eclipse.jgit.generated.storage.dht.proto.GitStore$ChunkMeta (Showing top 20 results out of 315)

  • Common ways to obtain GitStore$ChunkMeta
private void myMethod () {
GitStore$ChunkMeta g =
  • Codota IconGitStore.ChunkMeta$Builder gitStoreChunkMeta$Builder;gitStoreChunkMeta$Builder.build()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

@java.lang.Override
public int hashCode() {
 int hash = 41;
 hash = (19 * hash) + getDescriptorForType().hashCode();
 if (getBaseChunkCount() > 0) {
  hash = (37 * hash) + BASE_CHUNK_FIELD_NUMBER;
  hash = (53 * hash) + getBaseChunkList().hashCode();
 }
 if (getFragmentCount() > 0) {
  hash = (37 * hash) + FRAGMENT_FIELD_NUMBER;
  hash = (53 * hash) + getFragmentList().hashCode();
 }
 if (hasCommitPrefetch()) {
  hash = (37 * hash) + COMMIT_PREFETCH_FIELD_NUMBER;
  hash = (53 * hash) + getCommitPrefetch().hashCode();
 }
 if (hasTreePrefetch()) {
  hash = (37 * hash) + TREE_PREFETCH_FIELD_NUMBER;
  hash = (53 * hash) + getTreePrefetch().hashCode();
 }
 hash = (29 * hash) + getUnknownFields().hashCode();
 return hash;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 getSerializedSize();
 for (int i = 0; i < baseChunk_.size(); i++) {
  output.writeMessage(1, baseChunk_.get(i));
 }
 for (int i = 0; i < fragment_.size(); i++) {
  output.writeBytes(2, fragment_.getByteString(i));
 }
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  output.writeMessage(51, commitPrefetch_);
 }
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  output.writeMessage(52, treePrefetch_);
 }
 getUnknownFields().writeTo(output);
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public Builder mergeMeta(org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta value) {
 if (metaBuilder_ == null) {
  if (((bitField0_ & 0x00000004) == 0x00000004) &&
    meta_ != org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta.getDefaultInstance()) {
   meta_ =
    org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta.newBuilder(meta_).mergeFrom(value).buildPartial();
  } else {
   meta_ = value;
  }
  onChanged();
 } else {
  metaBuilder_.mergeFrom(value);
 }
 bitField0_ |= 0x00000004;
 return this;
}
public Builder clearMeta() {
origin: com.madgag/org.eclipse.jgit.storage.dht

static ChunkKey getNextFragment(ChunkMeta meta, ChunkKey chunkKey) {
  int cnt = meta.getFragmentCount();
  for (int i = 0; i < cnt - 1; i++) {
    ChunkKey key = ChunkKey.fromString(meta.getFragment(i));
    if (chunkKey.equals(key))
      return ChunkKey.fromString(meta.getFragment(i + 1));
  }
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 getSerializedSize();
 for (int i = 0; i < baseChunk_.size(); i++) {
  output.writeMessage(1, baseChunk_.get(i));
 }
 for (int i = 0; i < fragment_.size(); i++) {
  output.writeBytes(2, fragment_.getByteString(i));
 }
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  output.writeMessage(51, commitPrefetch_);
 }
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  output.writeMessage(52, treePrefetch_);
 }
 getUnknownFields().writeTo(output);
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public Builder mergeMeta(org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta value) {
 if (metaBuilder_ == null) {
  if (((bitField0_ & 0x00000004) == 0x00000004) &&
    meta_ != org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta.getDefaultInstance()) {
   meta_ =
    org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta.newBuilder(meta_).mergeFrom(value).buildPartial();
  } else {
   meta_ = value;
  }
  onChanged();
 } else {
  metaBuilder_.mergeFrom(value);
 }
 bitField0_ |= 0x00000004;
 return this;
}
public Builder clearMeta() {
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

void push(ChunkMeta meta) {
  if (meta == null)
    return;
  ChunkMeta.PrefetchHint hint;
  switch (objectType) {
  case OBJ_COMMIT:
    hint = meta.getCommitPrefetch();
    break;
  case OBJ_TREE:
    hint = meta.getTreePrefetch();
    break;
  default:
    return;
  }
  if (hint != null) {
    synchronized (this) {
      if (followEdgeHints && 0 < hint.getEdgeCount())
        push(hint.getEdgeList());
      else
        push(hint.getSequentialList());
    }
  }
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public int read(byte[] dstbuf, int dstptr, int dstlen)
    throws IOException {
  if (0 == dstlen)
    return 0;
  int n = pc.read(ptr, dstbuf, dstptr, dstlen);
  if (n == 0) {
    if (fragment == meta.getFragmentCount())
      return -1;
    pc = ctx.getChunk(ChunkKey.fromString(
        meta.getFragment(++fragment)));
    ptr = 0;
    n = pc.read(ptr, dstbuf, dstptr, dstlen);
    if (n == 0)
      return -1;
  }
  ptr += n;
  return n;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

@java.lang.Override
public int hashCode() {
 int hash = 41;
 hash = (19 * hash) + getDescriptorForType().hashCode();
 if (getBaseChunkCount() > 0) {
  hash = (37 * hash) + BASE_CHUNK_FIELD_NUMBER;
  hash = (53 * hash) + getBaseChunkList().hashCode();
 }
 if (getFragmentCount() > 0) {
  hash = (37 * hash) + FRAGMENT_FIELD_NUMBER;
  hash = (53 * hash) + getFragmentList().hashCode();
 }
 if (hasCommitPrefetch()) {
  hash = (37 * hash) + COMMIT_PREFETCH_FIELD_NUMBER;
  hash = (53 * hash) + getCommitPrefetch().hashCode();
 }
 if (hasTreePrefetch()) {
  hash = (37 * hash) + TREE_PREFETCH_FIELD_NUMBER;
  hash = (53 * hash) + getTreePrefetch().hashCode();
 }
 hash = (29 * hash) + getUnknownFields().hashCode();
 return hash;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private void endFragmentedObject() throws DhtException {
  currChunk.setFragment();
  ChunkKey lastKey = endChunk(typeOf(currChunkPtr));
  if (lastKey != null)
    currFragments.add(lastKey);
  ChunkMeta.Builder protoBuilder = ChunkMeta.newBuilder();
  for (ChunkKey key : currFragments)
    protoBuilder.addFragment(key.asString());
  ChunkMeta protoMeta = protoBuilder.build();
  for (ChunkKey key : currFragments) {
    ChunkMeta oldMeta = chunkMeta.get(key);
    if (oldMeta != null) {
      ChunkMeta.Builder newMeta = ChunkMeta.newBuilder(oldMeta);
      newMeta.clearFragment();
      newMeta.mergeFrom(protoMeta);
      ChunkMeta meta = newMeta.build();
      dirtyMeta.put(key, meta);
      chunkMeta.put(key, meta);
    } else {
      dirtyMeta.put(key, protoMeta);
      chunkMeta.put(key, protoMeta);
    }
  }
  currFragments = null;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

void push(ChunkMeta meta) {
  if (meta == null)
    return;
  ChunkMeta.PrefetchHint hint;
  switch (objectType) {
  case OBJ_COMMIT:
    hint = meta.getCommitPrefetch();
    break;
  case OBJ_TREE:
    hint = meta.getTreePrefetch();
    break;
  default:
    return;
  }
  if (hint != null) {
    synchronized (this) {
      if (followEdgeHints && 0 < hint.getEdgeCount())
        push(hint.getEdgeList());
      else
        push(hint.getSequentialList());
    }
  }
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public Builder toBuilder() { return newBuilder(this); }
origin: com.madgag/org.eclipse.jgit.storage.dht

private void endFragmentedObject() throws DhtException {
  currChunk.setFragment();
  ChunkKey lastKey = endChunk(typeOf(currChunkPtr));
  if (lastKey != null)
    currFragments.add(lastKey);
  ChunkMeta.Builder protoBuilder = ChunkMeta.newBuilder();
  for (ChunkKey key : currFragments)
    protoBuilder.addFragment(key.asString());
  ChunkMeta protoMeta = protoBuilder.build();
  for (ChunkKey key : currFragments) {
    ChunkMeta oldMeta = chunkMeta.get(key);
    if (oldMeta != null) {
      ChunkMeta.Builder newMeta = ChunkMeta.newBuilder(oldMeta);
      newMeta.clearFragment();
      newMeta.mergeFrom(protoMeta);
      ChunkMeta meta = newMeta.build();
      dirtyMeta.put(key, meta);
      chunkMeta.put(key, meta);
    } else {
      dirtyMeta.put(key, protoMeta);
      chunkMeta.put(key, protoMeta);
    }
  }
  currFragments = null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public Builder toBuilder() { return newBuilder(this); }
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

@java.lang.Override
public boolean equals(final Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta)) {
  return super.equals(obj);
 }
 org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta other = (org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta) obj;
 boolean result = true;
 result = result && getBaseChunkList()
   .equals(other.getBaseChunkList());
 result = result && getFragmentList()
   .equals(other.getFragmentList());
 result = result && (hasCommitPrefetch() == other.hasCommitPrefetch());
 if (hasCommitPrefetch()) {
  result = result && getCommitPrefetch()
    .equals(other.getCommitPrefetch());
 }
 result = result && (hasTreePrefetch() == other.hasTreePrefetch());
 if (hasTreePrefetch()) {
  result = result && getTreePrefetch()
    .equals(other.getTreePrefetch());
 }
 result = result &&
   getUnknownFields().equals(other.getUnknownFields());
 return result;
}
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta prototype) {
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

@java.lang.Override
public boolean equals(final Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta)) {
  return super.equals(obj);
 }
 org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta other = (org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta) obj;
 boolean result = true;
 result = result && getBaseChunkList()
   .equals(other.getBaseChunkList());
 result = result && getFragmentList()
   .equals(other.getFragmentList());
 result = result && (hasCommitPrefetch() == other.hasCommitPrefetch());
 if (hasCommitPrefetch()) {
  result = result && getCommitPrefetch()
    .equals(other.getCommitPrefetch());
 }
 result = result && (hasTreePrefetch() == other.hasTreePrefetch());
 if (hasTreePrefetch()) {
  result = result && getTreePrefetch()
    .equals(other.getTreePrefetch());
 }
 result = result &&
   getUnknownFields().equals(other.getUnknownFields());
 return result;
}
origin: com.madgag/org.eclipse.jgit.generated.storage.dht.proto

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.eclipse.jgit.generated.storage.dht.proto.GitStore.ChunkMeta prototype) {
origin: org.eclipse.jgit/org.eclipse.jgit.generated.storage.dht.proto

@java.lang.Override
public boolean equals(final Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof org.eclipse.jgit.generated.storage.dht.proto.GitCache.CachedChunk)) {
  return super.equals(obj);
 }
 org.eclipse.jgit.generated.storage.dht.proto.GitCache.CachedChunk other = (org.eclipse.jgit.generated.storage.dht.proto.GitCache.CachedChunk) obj;
 boolean result = true;
 result = result && (hasData() == other.hasData());
 if (hasData()) {
  result = result && getData()
    .equals(other.getData());
 }
 result = result && (hasIndex() == other.hasIndex());
 if (hasIndex()) {
  result = result && getIndex()
    .equals(other.getIndex());
 }
 result = result && (hasMeta() == other.hasMeta());
 if (hasMeta()) {
  result = result && getMeta()
    .equals(other.getMeta());
 }
 result = result &&
   getUnknownFields().equals(other.getUnknownFields());
 return result;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public void put(PackChunk.Members chunk, WriteBuffer buffer)
    throws DhtException {
  CacheBuffer buf = (CacheBuffer) buffer;
  db.put(chunk, buf.getWriteBuffer());
  // Only store fragmented meta. This is all callers should ask for.
  if (chunk.hasMeta() && chunk.getMeta().getFragmentCount() != 0) {
    buf.put(nsMeta.key(chunk.getChunkKey()),
        chunk.getMeta().toByteArray());
  }
  if (chunk.hasChunkData())
    buf.put(nsChunk.key(chunk.getChunkKey()), encode(chunk));
  else
    buf.removeAfterFlush(nsChunk.key(chunk.getChunkKey()));
}
org.eclipse.jgit.generated.storage.dht.protoGitStore$ChunkMeta

Most used methods

  • getBaseChunkCount
  • getBaseChunkList
  • getCommitPrefetch
  • getFragmentCount
  • getSerializedSize
  • getTreePrefetch
  • newBuilder
  • <init>
  • equals
  • getBaseChunk
  • getDefaultInstance
  • getDescriptor
  • getDefaultInstance,
  • getDescriptor,
  • getDescriptorForType,
  • getFragment,
  • getFragmentList,
  • getUnknownFields,
  • hasCommitPrefetch,
  • hasTreePrefetch,
  • hashCode,
  • isInitialized

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now