All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gemstone.gemfire.internal.StatArchiveFormat Maven / Gradle / Ivy

/*
 * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License. You
 * may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License. See accompanying
 * LICENSE file.
 */
package com.gemstone.gemfire.internal;

/**
 * StatArchiveFormat defines constants related to the statistic archive
 * file format.
 */
public interface StatArchiveFormat {
  /**
   * ARCHIVE_VERSION identifies the format of the contents of the archive.
   * It should be changed any time an incompatible change is made.
   * Its current value is 3.
   * 

*

    *
  1. Changed from 2 to 3 with addition of RESOURCE_INSTANCE_INITIALIZE_TOKEN *
  2. Changed from 3 to 4 with addition of largerBetter boolean in statistic descriptor *
*/ public static final byte ARCHIVE_VERSION=4; /** * Token consists of a timestamp and any statistic value changes. */ public static final byte SAMPLE_TOKEN=0; /** * Token defines a new resource type. */ public static final byte RESOURCE_TYPE_TOKEN=1; /** * Token defines a new resource instance. */ public static final byte RESOURCE_INSTANCE_CREATE_TOKEN=2; /** * Token notes that a previous resource instance no longer exists * and thus will have any more samples of its statistic values taken. */ public static final byte RESOURCE_INSTANCE_DELETE_TOKEN=3; /** * Token defines a new resource instance with initial data. */ public static final byte RESOURCE_INSTANCE_INITIALIZE_TOKEN=4; /** * Token defines a new archive and provides some global information * about the environment the archive was created in. */ public static final byte HEADER_TOKEN=77; /** * The value used to signal the end of a list of resource instances. */ public static final int ILLEGAL_RESOURCE_INST_ID=-1; /** * The maximum value a resource inst id can have and still be stored * in the archive as an unsigned byte. */ public static final int MAX_BYTE_RESOURCE_INST_ID=252; /** * Used to say that the next two bytes contain the resource inst id * as an unsigned short. */ public static final int SHORT_RESOURCE_INST_ID_TOKEN=253; /** * Used to say that the next four bytes contain the resource inst id * as an int. */ public static final int INT_RESOURCE_INST_ID_TOKEN=254; /** * Used to say that the current byte represents the ILLEGAL_RESOURCE_INST_ID. */ public static final int ILLEGAL_RESOURCE_INST_ID_TOKEN=255; /** * The maximum value a resource inst id can have and still be stored * in the archive as an unsigned short. */ public static final int MAX_SHORT_RESOURCE_INST_ID=65535; /** * The value used to signal the end of a list of statistic samples. */ public static final int ILLEGAL_STAT_OFFSET=255; /** * The maximum value a timestamp can have and still be stored * in the archive as an unsigned short. */ public static final int MAX_SHORT_TIMESTAMP=65534; /** * Means the next 4 bytes contain the timestamp as an int. */ public static final int INT_TIMESTAMP_TOKEN=65535; /** * The maximum value a compact value can have and still be stored * in the archive as one byte. */ public static final int MAX_1BYTE_COMPACT_VALUE=Byte.MAX_VALUE; /** * The minimum value a compact value can have and still be stored * in the archive as one byte. */ public static final int MIN_1BYTE_COMPACT_VALUE=Byte.MIN_VALUE+7; /** * The maximum value a compact value can have and still be stored * in the archive as two bytes. */ public static final int MAX_2BYTE_COMPACT_VALUE=Short.MAX_VALUE; /** * The minimum value a compact value can have and still be stored * in the archive as two bytes. */ public static final int MIN_2BYTE_COMPACT_VALUE=Short.MIN_VALUE; /** * Means the next 2 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_2_TOKEN=Byte.MIN_VALUE; /** * Means the next 3 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_3_TOKEN=Byte.MIN_VALUE+1; /** * Means the next 4 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_4_TOKEN=Byte.MIN_VALUE+2; /** * Means the next 5 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_5_TOKEN=Byte.MIN_VALUE+3; /** * Means the next 6 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_6_TOKEN=Byte.MIN_VALUE+4; /** * Means the next 7 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_7_TOKEN=Byte.MIN_VALUE+5; /** * Means the next 8 bytes hold the compact value's data. */ public static final int COMPACT_VALUE_8_TOKEN=Byte.MIN_VALUE+6; /** * Statistic represents a boolean java primitive. */ public static final int BOOLEAN_CODE = 1; /** * Statistic represents a char java primitive. */ public static final int CHAR_CODE = 2; /** * Statistic represents a char java primitive. */ public static final int WCHAR_CODE = 12; /** * Statistic represents a byte java primitive. */ public static final int BYTE_CODE = 3; /** * Statistic represents a short java primitive. */ public static final int SHORT_CODE = 4; /** * Statistic represents a int java primitive. */ public static final int INT_CODE = 5; /** * Statistic represents a long java primitive. */ public static final int LONG_CODE = 6; /** * Statistic represents a float java primitive. */ public static final int FLOAT_CODE = 7; /** * Statistic represents a double java primitive. */ public static final int DOUBLE_CODE = 8; /** * Number of nanoseconds in one millisecond */ public static final long NANOS_PER_MILLI = 1000000; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy