Codota Logo
DataUtils.appendMap
Code IndexAdd Codota to your IDE (free)

How to use
appendMap
method
in
org.h2.mvstore.DataUtils

Best Java code snippets using org.h2.mvstore.DataUtils.appendMap (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: com.h2database/h2

/**
 * Get the chunk data as a string.
 *
 * @return the string
 */
public String asString() {
  StringBuilder buff = new StringBuilder(240);
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "len", len);
  if (maxLen != maxLenLive) {
    DataUtils.appendMap(buff, "liveMax", maxLenLive);
  }
  if (pageCount != pageCountLive) {
    DataUtils.appendMap(buff, "livePages", pageCountLive);
  }
  DataUtils.appendMap(buff, "map", mapId);
  DataUtils.appendMap(buff, "max", maxLen);
  if (next != 0) {
    DataUtils.appendMap(buff, "next", next);
  }
  DataUtils.appendMap(buff, "pages", pageCount);
  DataUtils.appendMap(buff, "root", metaRootPos);
  DataUtils.appendMap(buff, "time", time);
  if (unused != 0) {
    DataUtils.appendMap(buff, "unused", unused);
  }
  DataUtils.appendMap(buff, "version", version);
  return buff.toString();
}
origin: com.h2database/h2

@Override
public String toString() {
  return DataUtils.appendMap(new StringBuilder(), config).toString();
}
origin: com.h2database/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder(FOOTER_LENGTH);
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append('\n');
  return buff.toString().getBytes(StandardCharsets.ISO_8859_1);
}
origin: com.h2database/h2

/**
 * Get the map metadata as a string.
 *
 * @param name the map name (or null)
 * @return the string
 */
String asString(String name) {
  StringBuilder buff = new StringBuilder();
  if (name != null) {
    DataUtils.appendMap(buff, "name", name);
  }
  if (createVersion != 0) {
    DataUtils.appendMap(buff, "createVersion", createVersion);
  }
  String type = getType();
  if (type != null) {
    DataUtils.appendMap(buff, "type", type);
  }
  return buff.toString();
}
origin: com.h2database/h2

/**
 * Append a map to the string builder, sorted by key.
 *
 * @param buff the target buffer
 * @param map the map
 * @return the string builder
 */
public static StringBuilder appendMap(StringBuilder buff, HashMap<String, ?> map) {
  Object[] keys = map.keySet().toArray();
  Arrays.sort(keys);
  for (Object k : keys) {
    String key = (String) k;
    Object value = map.get(key);
    if (value instanceof Long) {
      appendMap(buff, key, (long) value);
    } else if (value instanceof Integer) {
      appendMap(buff, key, (int) value);
    } else {
      appendMap(buff, key, value.toString());
    }
  }
  return buff;
}
origin: com.h2database/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder(112);
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append('\n');
  bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: com.h2database/h2-mvstore

@Override
public String toString() {
  return DataUtils.appendMap(new StringBuilder(), config).toString();
}
origin: com.eventsourcing/h2

@Override
public String toString() {
  return DataUtils.appendMap(new StringBuilder(), config).toString();
}
origin: org.wowtools/h2

@Override
public String toString() {
  return DataUtils.appendMap(new StringBuilder(), config).toString();
}
origin: com.eventsourcing/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder();
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < Chunk.FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append("\n");
  return buff.toString().getBytes(DataUtils.LATIN);
}
origin: com.h2database/h2-mvstore

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder(FOOTER_LENGTH);
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append('\n');
  return buff.toString().getBytes(StandardCharsets.ISO_8859_1);
}
origin: org.wowtools/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder();
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < Chunk.FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append("\n");
  return buff.toString().getBytes(DataUtils.LATIN);
}
origin: com.eventsourcing/h2

/**
 * Get the map metadata as a string.
 *
 * @param name the map name (or null)
 * @return the string
 */
String asString(String name) {
  StringBuilder buff = new StringBuilder();
  if (name != null) {
    DataUtils.appendMap(buff, "name", name);
  }
  if (createVersion != 0) {
    DataUtils.appendMap(buff, "createVersion", createVersion);
  }
  String type = getType();
  if (type != null) {
    DataUtils.appendMap(buff, "type", type);
  }
  return buff.toString();
}
origin: com.h2database/h2-mvstore

/**
 * Get the map metadata as a string.
 *
 * @param name the map name (or null)
 * @return the string
 */
String asString(String name) {
  StringBuilder buff = new StringBuilder();
  if (name != null) {
    DataUtils.appendMap(buff, "name", name);
  }
  if (createVersion != 0) {
    DataUtils.appendMap(buff, "createVersion", createVersion);
  }
  String type = getType();
  if (type != null) {
    DataUtils.appendMap(buff, "type", type);
  }
  return buff.toString();
}
origin: org.wowtools/h2

/**
 * Get the map metadata as a string.
 *
 * @param name the map name (or null)
 * @return the string
 */
String asString(String name) {
  StringBuilder buff = new StringBuilder();
  if (name != null) {
    DataUtils.appendMap(buff, "name", name);
  }
  if (createVersion != 0) {
    DataUtils.appendMap(buff, "createVersion", createVersion);
  }
  String type = getType();
  if (type != null) {
    DataUtils.appendMap(buff, "type", type);
  }
  return buff.toString();
}
origin: org.wowtools/h2

/**
 * Append a map to the string builder, sorted by key.
 *
 * @param buff the target buffer
 * @param map the map
 * @return the string builder
 */
public static StringBuilder appendMap(StringBuilder buff,
    HashMap<String, ?> map) {
  ArrayList<String> list = New.arrayList(map.keySet());
  Collections.sort(list);
  for (String k : list) {
    appendMap(buff, k, map.get(k));
  }
  return buff;
}
origin: com.eventsourcing/h2

/**
 * Append a map to the string builder, sorted by key.
 *
 * @param buff the target buffer
 * @param map the map
 * @return the string builder
 */
public static StringBuilder appendMap(StringBuilder buff,
    HashMap<String, ?> map) {
  ArrayList<String> list = New.arrayList(map.keySet());
  Collections.sort(list);
  for (String k : list) {
    appendMap(buff, k, map.get(k));
  }
  return buff;
}
origin: com.h2database/h2-mvstore

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder(112);
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append('\n');
  bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: com.eventsourcing/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder();
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append("\n");
  bytes = buff.toString().getBytes(DataUtils.LATIN);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: org.wowtools/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder();
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append("\n");
  bytes = buff.toString().getBytes(DataUtils.LATIN);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
org.h2.mvstoreDataUtilsappendMap

Javadoc

Append a key-value pair to the string builder. Keys may not contain a colon.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • checkArgument
    Throw an IllegalArgumentException if the argument is invalid.
  • copyExcept
    Copy the elements of an array, and remove one element.
  • copyWithGap
    Copy the elements of an array, with a gap.
  • encodeLength
    Convert the length to a length code 0..31. 31 means more than 1 MB.
  • formatMessage
    Format an error message.
  • getCheckValue
    Calculate a check value for the given integer. A check value is mean to verify the data is consisten
  • getErrorCode
    Get the error code from an exception message.
  • getFletcher32
    Calculate the Fletcher32 checksum.
  • getPageChunkId
    Get the chunk id from the position.
  • getPageMaxLength
    Get the maximum length for the given code. For the code 31, PAGE_LARGE is returned.
  • getPageOffset
    Get the offset from the position.
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • notifyDataSetChanged (ArrayAdapter)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JList (javax.swing)
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