Tabnine Logo
DataUtils.readHexInt
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.h2database/h2

/**
 * Build a block from the given string.
 *
 * @param s the string
 * @return the block
 */
public static Chunk fromString(String s) {
  HashMap<String, String> map = DataUtils.parseMap(s);
  int id = DataUtils.readHexInt(map, "chunk", 0);
  Chunk c = new Chunk(id);
  c.block = DataUtils.readHexLong(map, "block", 0);
  c.len = DataUtils.readHexInt(map, "len", 0);
  c.pageCount = DataUtils.readHexInt(map, "pages", 0);
  c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount);
  c.mapId = DataUtils.readHexInt(map, "map", 0);
  c.maxLen = DataUtils.readHexLong(map, "max", 0);
  c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen);
  c.metaRootPos = DataUtils.readHexLong(map, "root", 0);
  c.time = DataUtils.readHexLong(map, "time", 0);
  c.unused = DataUtils.readHexLong(map, "unused", 0);
  c.version = DataUtils.readHexLong(map, "version", id);
  c.next = DataUtils.readHexLong(map, "next", 0);
  return c;
}
origin: com.h2database/h2

/**
 * Try to read a chunk footer.
 *
 * @param end the end of the chunk
 * @return the chunk, or null if not successful
 */
private Chunk readChunkFooter(long end) {
  // the following can fail for various reasons
  try {
    // read the chunk footer of the last block of the file
    ByteBuffer lastBlock = fileStore.readFully(
        end - Chunk.FOOTER_LENGTH, Chunk.FOOTER_LENGTH);
    byte[] buff = new byte[Chunk.FOOTER_LENGTH];
    lastBlock.get(buff);
    HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
    if (m != null) {
      int chunk = DataUtils.readHexInt(m, "chunk", 0);
      Chunk c = new Chunk(chunk);
      c.version = DataUtils.readHexLong(m, "version", 0);
      c.block = DataUtils.readHexLong(m, "block", 0);
      return c;
    }
  } catch (Exception e) {
    // ignore
  }
  return null;
}
origin: com.h2database/h2

  continue;
int blockSize = DataUtils.readHexInt(
    m, "blockSize", BLOCK_SIZE);
if (blockSize != BLOCK_SIZE) {
  storeHeader.putAll(m);
  creationTime = DataUtils.readHexLong(m, "created", 0);
  int chunkId = DataUtils.readHexInt(m, "chunk", 0);
  long block = DataUtils.readHexLong(m, "block", 0);
  Chunk test = readChunkHeaderAndFooter(block);
origin: com.h2database/h2

int chunkId = DataUtils.readHexInt(storeHeader, "chunk", 0);
while (true) {
  Chunk old = chunks.get(chunkId);
origin: org.wowtools/h2

/**
 * Open this map with the given store and configuration.
 *
 * @param store the store
 * @param config the configuration
 */
protected void init(MVStore store, HashMap<String, Object> config) {
  this.store = store;
  this.id = DataUtils.readHexInt(config, "id", 0);
  this.createVersion = DataUtils.readHexLong(config, "createVersion", 0);
  this.writeVersion = store.getCurrentVersion();
}
origin: com.eventsourcing/h2

/**
 * Open this map with the given store and configuration.
 *
 * @param store the store
 * @param config the configuration
 */
protected void init(MVStore store, HashMap<String, Object> config) {
  this.store = store;
  this.id = DataUtils.readHexInt(config, "id", 0);
  this.createVersion = DataUtils.readHexLong(config, "createVersion", 0);
  this.writeVersion = store.getCurrentVersion();
}
origin: org.wowtools/h2

/**
 * Build a block from the given string.
 *
 * @param s the string
 * @return the block
 */
public static Chunk fromString(String s) {
  HashMap<String, String> map = DataUtils.parseMap(s);
  int id = DataUtils.readHexInt(map, "chunk", 0);
  Chunk c = new Chunk(id);
  c.block = DataUtils.readHexLong(map, "block", 0);
  c.len = DataUtils.readHexInt(map, "len", 0);
  c.pageCount = DataUtils.readHexInt(map, "pages", 0);
  c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount);
  c.mapId = DataUtils.readHexInt(map, "map", 0);
  c.maxLen = DataUtils.readHexLong(map, "max", 0);
  c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen);
  c.metaRootPos = DataUtils.readHexLong(map, "root", 0);
  c.time = DataUtils.readHexLong(map, "time", 0);
  c.unused = DataUtils.readHexLong(map, "unused", 0);
  c.version = DataUtils.readHexLong(map, "version", id);
  c.next = DataUtils.readHexLong(map, "next", 0);
  return c;
}
origin: com.eventsourcing/h2

/**
 * Build a block from the given string.
 *
 * @param s the string
 * @return the block
 */
public static Chunk fromString(String s) {
  HashMap<String, String> map = DataUtils.parseMap(s);
  int id = DataUtils.readHexInt(map, "chunk", 0);
  Chunk c = new Chunk(id);
  c.block = DataUtils.readHexLong(map, "block", 0);
  c.len = DataUtils.readHexInt(map, "len", 0);
  c.pageCount = DataUtils.readHexInt(map, "pages", 0);
  c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount);
  c.mapId = DataUtils.readHexInt(map, "map", 0);
  c.maxLen = DataUtils.readHexLong(map, "max", 0);
  c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen);
  c.metaRootPos = DataUtils.readHexLong(map, "root", 0);
  c.time = DataUtils.readHexLong(map, "time", 0);
  c.unused = DataUtils.readHexLong(map, "unused", 0);
  c.version = DataUtils.readHexLong(map, "version", id);
  c.next = DataUtils.readHexLong(map, "next", 0);
  return c;
}
origin: org.wowtools/h2

String s = new String(buff, DataUtils.LATIN).trim();
HashMap<String, String> m = DataUtils.parseMap(s);
int check = DataUtils.readHexInt(m, "fletcher", 0);
m.remove("fletcher");
s = s.substring(0, s.lastIndexOf("fletcher") - 1);
int checksum = DataUtils.getFletcher32(bytes, bytes.length);
if (check == checksum) {
  int chunk = DataUtils.readHexInt(m, "chunk", 0);
  Chunk c = new Chunk(chunk);
  c.version = DataUtils.readHexLong(m, "version", 0);
origin: com.h2database/h2-mvstore

/**
 * Build a block from the given string.
 *
 * @param s the string
 * @return the block
 */
public static Chunk fromString(String s) {
  HashMap<String, String> map = DataUtils.parseMap(s);
  int id = DataUtils.readHexInt(map, "chunk", 0);
  Chunk c = new Chunk(id);
  c.block = DataUtils.readHexLong(map, "block", 0);
  c.len = DataUtils.readHexInt(map, "len", 0);
  c.pageCount = DataUtils.readHexInt(map, "pages", 0);
  c.pageCountLive = DataUtils.readHexInt(map, "livePages", c.pageCount);
  c.mapId = DataUtils.readHexInt(map, "map", 0);
  c.maxLen = DataUtils.readHexLong(map, "max", 0);
  c.maxLenLive = DataUtils.readHexLong(map, "liveMax", c.maxLen);
  c.metaRootPos = DataUtils.readHexLong(map, "root", 0);
  c.time = DataUtils.readHexLong(map, "time", 0);
  c.unused = DataUtils.readHexLong(map, "unused", 0);
  c.version = DataUtils.readHexLong(map, "version", id);
  c.next = DataUtils.readHexLong(map, "next", 0);
  return c;
}
origin: com.eventsourcing/h2

String s = new String(buff, DataUtils.LATIN).trim();
HashMap<String, String> m = DataUtils.parseMap(s);
int check = DataUtils.readHexInt(m, "fletcher", 0);
m.remove("fletcher");
s = s.substring(0, s.lastIndexOf("fletcher") - 1);
int checksum = DataUtils.getFletcher32(bytes, bytes.length);
if (check == checksum) {
  int chunk = DataUtils.readHexInt(m, "chunk", 0);
  Chunk c = new Chunk(chunk);
  c.version = DataUtils.readHexLong(m, "version", 0);
origin: com.h2database/h2-mvstore

/**
 * Try to read a chunk footer.
 *
 * @param end the end of the chunk
 * @return the chunk, or null if not successful
 */
private Chunk readChunkFooter(long end) {
  // the following can fail for various reasons
  try {
    // read the chunk footer of the last block of the file
    ByteBuffer lastBlock = fileStore.readFully(
        end - Chunk.FOOTER_LENGTH, Chunk.FOOTER_LENGTH);
    byte[] buff = new byte[Chunk.FOOTER_LENGTH];
    lastBlock.get(buff);
    HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
    if (m != null) {
      int chunk = DataUtils.readHexInt(m, "chunk", 0);
      Chunk c = new Chunk(chunk);
      c.version = DataUtils.readHexLong(m, "version", 0);
      c.block = DataUtils.readHexLong(m, "block", 0);
      return c;
    }
  } catch (Exception e) {
    // ignore
  }
  return null;
}
origin: org.wowtools/h2

    DataUtils.LATIN).trim();
HashMap<String, String> m = DataUtils.parseMap(s);
int blockSize = DataUtils.readHexInt(
    m, "blockSize", BLOCK_SIZE);
if (blockSize != BLOCK_SIZE) {
      blockSize);
int check = DataUtils.readHexInt(m, "fletcher", 0);
m.remove("fletcher");
s = s.substring(0, s.lastIndexOf("fletcher") - 1);
  storeHeader.putAll(m);
  creationTime = DataUtils.readHexLong(m, "created", 0);
  int chunkId = DataUtils.readHexInt(m, "chunk", 0);
  long block = DataUtils.readHexLong(m, "block", 0);
  Chunk test = readChunkHeaderAndFooter(block);
origin: com.eventsourcing/h2

    DataUtils.LATIN).trim();
HashMap<String, String> m = DataUtils.parseMap(s);
int blockSize = DataUtils.readHexInt(
    m, "blockSize", BLOCK_SIZE);
if (blockSize != BLOCK_SIZE) {
      blockSize);
int check = DataUtils.readHexInt(m, "fletcher", 0);
m.remove("fletcher");
s = s.substring(0, s.lastIndexOf("fletcher") - 1);
  storeHeader.putAll(m);
  creationTime = DataUtils.readHexLong(m, "created", 0);
  int chunkId = DataUtils.readHexInt(m, "chunk", 0);
  long block = DataUtils.readHexLong(m, "block", 0);
  Chunk test = readChunkHeaderAndFooter(block);
origin: com.h2database/h2-mvstore

  continue;
int blockSize = DataUtils.readHexInt(
    m, "blockSize", BLOCK_SIZE);
if (blockSize != BLOCK_SIZE) {
  storeHeader.putAll(m);
  creationTime = DataUtils.readHexLong(m, "created", 0);
  int chunkId = DataUtils.readHexInt(m, "chunk", 0);
  long block = DataUtils.readHexLong(m, "block", 0);
  Chunk test = readChunkHeaderAndFooter(block);
origin: com.h2database/h2-mvstore

int chunkId = DataUtils.readHexInt(storeHeader, "chunk", 0);
while (true) {
  Chunk old = chunks.get(chunkId);
origin: com.eventsourcing/h2

int chunkId = DataUtils.readHexInt(storeHeader, "chunk", 0);
while (true) {
  Chunk old = chunks.get(chunkId);
origin: org.wowtools/h2

int chunkId = DataUtils.readHexInt(storeHeader, "chunk", 0);
while (true) {
  Chunk old = chunks.get(chunkId);
org.h2.mvstoreDataUtilsreadHexInt

Javadoc

Read a hex int value from a map.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • appendMap
    Append a map to the string builder, sorted by key.
  • 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.
  • getPageChunkId,
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now