Sun Microsystems Sun StorageTek 5800 manual
- Consulta online o descarga el manual de instrucciones
- 136 páginas
- 1.05 mb
Ir a la página of
manuales de instrucciones parecidos
-
Computer Drive
Sun Microsystems 96257
118 páginas 1.92 mb -
Computer Drive
Sun Microsystems Sun StorEdge 5210 NAS
100 páginas 1.02 mb -
Computer Drive
Sun Microsystems CP32x0
66 páginas 1.99 mb -
Computer Drive
Sun Microsystems HP LTO4
38 páginas 0.96 mb -
Computer Drive
Sun Microsystems StreamLine SL8500
200 páginas 3.43 mb -
Computer Drive
Sun Microsystems Netra CP32x0
66 páginas 2.09 mb -
Computer Drive
Sun Microsystems StorageTek 96257
118 páginas 2.01 mb -
Computer Drive
Sun Microsystems 150
20 páginas 1.15 mb
Buen manual de instrucciones
Las leyes obligan al vendedor a entregarle al comprador, junto con el producto, el manual de instrucciones Sun Microsystems Sun StorageTek 5800. La falta del manual o facilitar información incorrecta al consumidor constituyen una base de reclamación por no estar de acuerdo el producto con el contrato. Según la ley, está permitido adjuntar un manual de otra forma que no sea en papel, lo cual últimamente es bastante común y los fabricantes nos facilitan un manual gráfico, su versión electrónica Sun Microsystems Sun StorageTek 5800 o vídeos de instrucciones para usuarios. La condición es que tenga una forma legible y entendible.
¿Qué es un manual de instrucciones?
El nombre proviene de la palabra latina “instructio”, es decir, ordenar. Por lo tanto, en un manual Sun Microsystems Sun StorageTek 5800 se puede encontrar la descripción de las etapas de actuación. El propósito de un manual es enseñar, facilitar el encendido o el uso de un dispositivo o la realización de acciones concretas. Un manual de instrucciones también es una fuente de información acerca de un objeto o un servicio, es una pista.
Desafortunadamente pocos usuarios destinan su tiempo a leer manuales Sun Microsystems Sun StorageTek 5800, sin embargo, un buen manual nos permite, no solo conocer una cantidad de funcionalidades adicionales del dispositivo comprado, sino también evitar la mayoría de fallos.
Entonces, ¿qué debe contener el manual de instrucciones perfecto?
Sobre todo, un manual de instrucciones Sun Microsystems Sun StorageTek 5800 debe contener:
- información acerca de las especificaciones técnicas del dispositivo Sun Microsystems Sun StorageTek 5800
- nombre de fabricante y año de fabricación del dispositivo Sun Microsystems Sun StorageTek 5800
- condiciones de uso, configuración y mantenimiento del dispositivo Sun Microsystems Sun StorageTek 5800
- marcas de seguridad y certificados que confirmen su concordancia con determinadas normativas
¿Por qué no leemos los manuales de instrucciones?
Normalmente es por la falta de tiempo y seguridad acerca de las funcionalidades determinadas de los dispositivos comprados. Desafortunadamente la conexión y el encendido de Sun Microsystems Sun StorageTek 5800 no es suficiente. El manual de instrucciones siempre contiene una serie de indicaciones acerca de determinadas funcionalidades, normas de seguridad, consejos de mantenimiento (incluso qué productos usar), fallos eventuales de Sun Microsystems Sun StorageTek 5800 y maneras de solucionar los problemas que puedan ocurrir durante su uso. Al final, en un manual se pueden encontrar los detalles de servicio técnico Sun Microsystems en caso de que las soluciones propuestas no hayan funcionado. Actualmente gozan de éxito manuales de instrucciones en forma de animaciones interesantes o vídeo manuales que llegan al usuario mucho mejor que en forma de un folleto. Este tipo de manual ayuda a que el usuario vea el vídeo entero sin saltarse las especificaciones y las descripciones técnicas complicadas de Sun Microsystems Sun StorageTek 5800, como se suele hacer teniendo una versión en papel.
¿Por qué vale la pena leer los manuales de instrucciones?
Sobre todo es en ellos donde encontraremos las respuestas acerca de la construcción, las posibilidades del dispositivo Sun Microsystems Sun StorageTek 5800, el uso de determinados accesorios y una serie de informaciones que permiten aprovechar completamente sus funciones y comodidades.
Tras una compra exitosa de un equipo o un dispositivo, vale la pena dedicar un momento para familiarizarse con cada parte del manual Sun Microsystems Sun StorageTek 5800. Actualmente se preparan y traducen con dedicación, para que no solo sean comprensibles para los usuarios, sino que también cumplan su función básica de información y ayuda.
Índice de manuales de instrucciones
-
Página 1
Sun Stor age T ek 5800 S y stem Client API Refer ence Manual Sun Microsystems, Inc. 4150 N etwork Circle Santa Clara, CA 95054 U.S.A. Part N o: 820–4796 J une 2008[...]
-
Página 2
Copyright 2008 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. I n particular, and without limitation, these intellectual property rights may include one or more U.S[...]
-
Página 3
C ontents Preface ...................................................................................................................................................11 1 Sun Storage T ek 5800 Syst em Client API .......................................................................................... 15 Changes in Version 1.1 ......................[...]
-
Página 4
3 Sun Storage T ek 5800 Syst em C Client API ....................................................................................... 39 Overview of the 5800 System C Client API ...................................................................................... 39 Architecture ......................................................................[...]
-
Página 5
hc_session_get_platform_result ......................................................................................... 58 hc_session_get_archive .......................................................................................................... 59 Managing a Schema ...........................................................................[...]
-
Página 6
Storing Data and Metadata ......................................................................................................... 87 hc_store_both_ez ...................................................................................................................... 87 hc_store_metadata_ez .......................................................[...]
-
Página 7
Supported Data Types ....................................................................................................................... 116 Queries ................................................................................................................................................ 117 Translating a Query to the Underlying Database .[...]
-
Página 8
8[...]
-
Página 9
T ables T ABLE 4–1 Canonical String Representation of Data Types .................................................. 119 9[...]
-
Página 10
10[...]
-
Página 11
P refac e The Sun StorageTek 5800 System Client API Reference M anual is written for programmers and application developers who develop custom applications for the Sun StorageTek TM 5800 System. This document, along with the Sun StorageTek 5800 SystemSDK Reference M anual , provides the information that you need to develop custom applications for t[...]
-
Página 12
Relat ed Thir d-Party W eb Site Refer ences Third-party URLs are referenced in this document and provide additional, related information. Note – Sun is not responsible for the availability of third-party web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other mat[...]
-
Página 13
T ABLE P–1 Typographic C onventions (Continued) T ypeface Meaning Example A aBbCc123 Book titles, new terms, and terms to be emphasized Read Chapter 6 in the User's Guide . A cache is a copy that is stored locally. Do not save the le. Note: Some emphasized items appear bold online. Shell Pr ompts in Command Examples The following table sh[...]
-
Página 14
14[...]
-
Página 15
Sun Storage T ek 5800 System Client API The Sun TM StorageTek TM 5800 system client API provides programmatic access to a 5800 system server to store, retrieve, query, and delete object data and metadata. Synchronous versions are provided in C and J ava TM languages. A future release will implement a non-blocking C API for use with POSIX operations[...]
-
Página 16
In 5800 system version 1.1, an attempt to store a value that is longer than the associated eld generates an immediate error. 5800 S yst em O v er view This section provides an overviews of the 5800 system, the 5800 system history, and a summaries of the key points of the 5800 system usage model. The following topics are discussed: ■ “5800 Sy[...]
-
Página 17
This chapter provides a summary of key points of the 5800 system usage model that are useful for understanding either API. In the following sections, the terms from the J ava API are used as an aid to exposition. In all cases, a simple equivalent using the C API is available. ■ Chapter 4, “Sun StorageTek 5800 System Query Language, ” provides[...]
-
Página 18
Read-M ultiple (WORM) archive. Each object corresponds to a single stream of data and a single set of metadata; there are no “grouped objects” or “compound objects” other than by application convention. Each object corresponds to a single stream of data and a single set of metadata. There are no “grouped objects” or “compound objects?[...]
-
Página 19
The 5800 S y stem Metadata Model M etadata means “data about the data”; it describes the data and helps to determine how the data should be interpreted. In addition, metadata can be used to facilitate querying the 5800 system for objects that match a particular set of search criteria. For the 5800 system, the supported metadata option is in the[...]
-
Página 20
The metadata associated with an object is immutable. There is no operation to modify the metadata associated with an object after the object has been stored. Instead, the storeMetadata operation can be used to create a completely new object by associating new user metadata with the underlying data and system-metadata of an existing object. The stor[...]
-
Página 21
Query expressions can use much of the power of Structured Query Language (SQL). Each query expression combines SQL functions and operators, eld names from the metadata schema, and literal values. There are no query expressions that select objects based on the data stored in the object itself; all queries apply only to the metadata elds associ[...]
-
Página 22
Note – The format of records as stored in the reliable and scalable object archive is not suitable for fast query. To enable searching, the queryable elds from the metadata are indexed in a query engine that can provide fast and exible query services. The query engine is basically an SQL database. This is why the 5800 system's query la[...]
-
Página 23
match the original object metadata. There are no transactional guarantees regarding ordering of queries and delete operations that are occurring at the same time. If an object is being deleted at the same time that a query that matches that object is being performed, then that object may or may not show up in the query result set, with no guarantee[...]
-
Página 24
24[...]
-
Página 25
Sun Storage T ek 5800 System Ja va Client API This chapter provides information on the 5800 system J ava client API. The following topics are discussed: ■ “Overview of the 5800 System Java Client API ” on page 25 ■ “J ava Client A pplication Deployment” on page 27 ■ “J ava API” on page 27 Note – You can nd detailed informatio[...]
-
Página 26
The 5800 system J ava client library provides a platform-independent mechanism to upload data and metadata to a 5800 system, and to retrieve and query the data and metadata. The J ava client library works with any implementation of J2SE TM platform 4.0 or later with HTTP connectivity to the 5800 system cluster. A ccess is designed to be high-level [...]
-
Página 27
Updating Client Vie w of the Schema In the J ava client API, the schema is fetched when the NameValueObjectArchive class is instantiated. If the schema has changed, the client application needs to create a new NameValueArchive . A local copy of the schema is used for some metadata operations. Jav a Client Application Deployment J ava applications u[...]
-
Página 28
Basic C oncepts The root of the 5800 system J ava client API is the NameValueObjectArchive class, which represents a connection to a single 5800 system server. All operations are initiated by invoking methods on a NameValueObjectArchive instance after initializing it with the address of a cluster. The fact that a cluster of machines, rather than a [...]
-
Página 29
■ “ ObjectIdentifier ” on page 29 ■ “ QueryResultSet ” on page 30 ■ “ SystemRecord ” on page 30 ■ “ NameValueRecord ” on page 30 For more information on using these classes, see “Basic Concepts” on page 28 . NameValueObjectArchive The NameValueObjectArchive class is the main entry point into the 5800 system. Each instanc[...]
-
Página 30
later for retrieving objects. External storage can be accomplished using an identier's string representation by invoking the toString method. An instance of ObjectIdentifier can be reconstituted using the constructor that takes String as an argument. QueryResultSet Instances of QueryResultSet provide access to the objects and metadata match[...]
-
Página 31
■ “ query (with PreparedStatement )” on page 35 ■ “ query (with PreparedStatement and selectKeys )” on page 35 ■ “ PreparedStatement ” on page 36 ■ “ QueryResultSet ” on page 37 ■ “ getObjectIdentifier ” on page 37 ■ “ isQueryComplete ” on page 37 ■ “ getQueryIntegrityTime ” on page 38 ■ “ QueryIntegrit[...]
-
Página 32
Synopsis public SystemRecord storeObject(java.nio.channels.ReadableByteChannel dataChannel) public SystemRecord storeObject(ReadableByteChannel dataChannel,NameValueRecord record) throws ArchiveException,IOException Description Takes a ReadableByteChannel (and an optional NameValueRecord ) and returns a SystemRecord instance containing the system m[...]
-
Página 33
checkIndexed returns an int value that indicates if the metadata for this object has been inserted into the query engine. The value is -1 if the metadata was already inserted before this operation was called, 0 if the metadata has still not been inserted, or 1 if the metadata was just now inserted. retrieveObject Writes all of the data for the spec[...]
-
Página 34
Synopsis public NameValueSchema getSchema() throws ArchiveException, java.io.IOException Description Returns the runtime conguration of the name-value object archive as a NameValueSchema instance. query Returns a ResultSet of SystemRecord instances containing MetadataRecord OIDs. Synopsis public QueryResultSet query(java.lang.String query,int re[...]
-
Página 35
Description Takes a where clause and a select clause and returns a QueryResultSet of NameValueRecord instances containing the selected values. selectKeys identies the values to be returned, functioning as an SQL select clause. The query parameter is a where clause in the 5800 system query syntax, which is a subset of SQL. Returns a QueryResultSe[...]
-
Página 36
Synopsis public QueryResultSet query(PreparedStatement query, java.lang.String[] selectKeys, int resultsPerFetch) Description Takes a where clause and a select clause and returns a QueryResultSet of NameValueRecord instances containing the selected values. selectKeys identies the values to be returned, functioning as an SQL select clause. The Pr[...]
-
Página 37
stmt.bindParameter(date_value,1); QueryResultSet qrs = archive.query(stmt); QueryResultSet The QueryResultSet class is used to page through OIDs and associated metadata returned by NameValueObjectArchive.query . See the javadoc for the getXXX methods for getting typed metadata. next Sets the QueryResultSet to point at the next record. Synopsis bool[...]
-
Página 38
getQueryIntegrityTime Returns the most recent time at which all store index exceptions are known to have been resolved. Synopsis long getQueryIntegrityTime() Description The query integrity time is a time such that all store index exceptions from before that time have been resolved. There is an ideal query integrity time, which is the time of the o[...]
-
Página 39
Sun Storage T ek 5800 System C Client API This chapter provides detailed information on the 5800 system C client API. The following topics are discussed: ■ “Overview of the 5800 System C Client API” on page 39 ■ “C Client A pplication Deployment” on page 43 ■ “N onblocking C API” on page 43 ■ “Synchronous C API” on page 44 ?[...]
-
Página 40
Architecture The 5800 system C API client supports two dierent access patterns: a synchronous “EZ” access very similar to the current J ava implementation, and a more exible, nonblocking access based on the POSIX model. Note – For this release, the nonblocking C API client is not implemented. Inter faces The C client library interacts w[...]
-
Página 41
Memor y Usage The 5800 system C client library generally follows the model of populating externally allocated data structures such as handles, buers, and result arrays. Some internal data structures are generated during XML document construction. These data structures are allocated and freed using the function pointers supplied to hc_init when i[...]
-
Página 42
hcerr_t hc_init(allocator_t, deallocator_t, reallocator_t); This function must be called once per process to initialize the memory functions used in the 5800 system C API. I t also initializes global session properties. A global session is initialized once per process, regardless of how many threads in that process are using the C API. Note – hc_[...]
-
Página 43
■ oid — The objectid for this object, equivalent to the system.object_id eld. ■ digest_algo — Always set to " sha1 " for this release. Equivalent to the system.object_hash_alg eld. ■ data_digest — An array of bytes that represent the content digest of this object's data. Equivalent to the system.object_hash eld. [...]
-
Página 44
S ynchronous C API A multiplatform synchronous C API in which operations are accomplished in a few simple function calls is provided for the 5800 system. The API calls include operations for storing, retrieving, deleting, and querying of data and metadata records. M ultiple threads are supported, and operations block until they complete. You must c[...]
-
Página 45
– “ hc_nvr_get_time ” on page 82 – “ hc_nvr_get_timestamp ” on page 83 – “ hc_pstmt_create ” on page 100 – “ hc_pstmt_free ” on page 101 – “ hc_pstmt_set_string ” on page 101 – “ hc_pstmt_set_char ” on page 102 – “ hc_pstmt_set_double ” on page 103 – “ hc_pstmt_set_long ” on page 104 – “ hc_pstmt_[...]
-
Página 46
S ynchronous C Data T ypes The following data types are dened for the C API: ■ “ hc_string_t ” on page 46 ■ “ hc_long_t ” on page 46 ■ “ hc_double_t ” on page 46 ■ “ hc_type_t ” on page 47 ■ “ hc_value_t ” on page 47 ■ “ hc_schema_t ” on page 48 ■ “ hc_nvr_t ” on page 48 ■ “ hc_session_t ” on page [...]
-
Página 47
Synopsis typedef double hc_double_t; Description Type for holding oating-point values. hc_type_t 5800 system name-value metadata type specier. Synopsis typedef enum hc_types_{ HC_UNKNOWN_TYPE = -1, HC_BOGUS_TYPE = 0, HC_STRING_TYPE = 1, HC_LONG_TYPE = 2, HC_DOUBLE_TYPE = 3, HC_BYTE_TYPE = 4, HC_CHAR_TYPE = 5, HC_BINARY_TYPE = 6, HC_DATE_TYPE [...]
-
Página 48
hc_bytearray_t hcv_bytearray; struct tm hcv_tm; struct timespec hcv_timespec; } hcv; } hc_value_t; Description This tagged union type can be used to hold a reference to any of the 5800 system data types. hc_schema_t 5800 system name-value metadata schema. Synopsis typedef void hc_schema_t; Description An opaque structure that holds the names and da[...]
-
Página 49
Description An opaque structure to represent the session from one thread to one 5800 system server. I t contains the schema used to interpret metadata store and retrieve operations to this 5800 system server. hc_pstmt_t Structure for holding a prepared statement. Synopsis typedef void hc_pstmt_t; Description An opaque structure representing a query[...]
-
Página 50
Description Function pointers of read_from_data_source type are used to upload object data. The function pointer and opaque cookie reference are supplied as arguments to “ hc_store_both_ez ”o n page 87 and other functions that store object data. The data source reader function will be called repeatedly, with the supplied cookie as an argument, [...]
-
Página 51
Description Function pointers of write_to_data_destination type are used to download object data to a network or other destination from the 5800 system server using “ hc_retrieve_ez ” on page 91 . The function pointer and opaque cookie reference are supplied as arguments to “ hc_retrieve_ez ” on page 91 , and the function will be called wit[...]
-
Página 52
HCERR_BAD_REQUEST, HCERR_NO_SUCH_OBJECT, HCERR_INTERNAL_SERVER_ERROR, HCERR_FAILED_GETTING_FDSET, HCERR_FAILED_CHECKING_FDSET, HCERR_MISSING_SELECT_CLAUSE, HCERR_URL_TOO_LONG, HCERR_COULD_NOT_OPEN_FILE, HCERR_FAILED_TO_WRITE_TO_FILE, HCERR_NULL_SESSION, HCERR_INVALID_SESSION, HCERR_INVALID_OID, HCERR_NULL_HANDLE, HCERR_INVALID_HANDLE, HCERR_INVALID[...]
-
Página 53
Description This structure denes the 5800 system C client API error codes. S ynchronous C API F unc tions The 5800 system synchronous C API functions are dened to perform the following tasks: ■ “Managing 5800 System Sessions” on page 53 ■ “Managing a Schema” on page 59 ■ “Manipulating N ame-Value Records” on page 63 ■ “S[...]
-
Página 54
Description This function initializes the 5800 system API and must be called before calling any of the other functions in this API. I t downloads a copy of the schema for a particular host or port. The schema is used to validate the name-value-type tuples that are added to metadata records. Both the synchronous and the nonsynchronous C APIs are ful[...]
-
Página 55
hc_session_free Releases the session object. Synopsis hcerr_t hc_session_free (hc_session_t *session); Description This function releases the session object and recovers handles and memory for one connection. Par ameters session IN: The session object to free. Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_NULL_SESSION HCERR_INVALID_SESSIO[...]
-
Página 56
response_codep OUT: Updated to be the HTTP response code. errstr IN: Updated to be the error returned in the response body if the response code is not 200 (OK). errstr should not be written to by the application (that is, it is read only), and will persist until the next request to the 5800 system server or until “ hc_session_free ” on page 55 [...]
-
Página 57
Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_NULL_SESSION HCERR_INVALID_SESSION hc_session_get_host Returns the host name and port number associated with the session. Synopsis hc_session_get_host(hc_session_t *session, char **hostp,int *portp); Description This function returns the host name and port number associated with the session. P[...]
-
Página 58
hc_session_get_platform_result Returns low-level error codes associated with the current session. Synopsis hcerr_t hc_session_get_platform_result(hc_session_t *session, int32_t *connect_errnop, int32_t *platform_resultp); Description This function returns low-level error codes associated with the current session. Note – The values returned by hc_[...]
-
Página 59
hc_session_get_archive Returns the current archive object associated with this session. Synopsis hcerr_t hc_session_get_archive(hc_session_t *session, hc_archive_t **archivep); Description This function returns the current archive object associated with this session. Note – The archive object is not needed for the synchronous C API, but is made a[...]
-
Página 60
■ “ hc_schema_get_type_at_index ” on page 62 hc_schema_get_type Looks up type in schema. Synopsis hcerr_t hc_schema_get_type(hc_schema_t *schema, char *name, hc_type_t *typep); Description This function looks up the type associated with a given name in the current metadata schema, or returns an error if the name is not known. Par ameters sche[...]
-
Página 61
hc_schema_get_length Looks up length of char and string attribute elds. Synopsis hcerr_t hc_schema_get_length(hc_schema_t *schema, char *name, int *length); Description This function looks up the length of a char or string eld associated with a given attribute name in the current metadata schema, or returns an error if the name is not known. [...]
-
Página 62
Description This function returns the number of name-value pairs in the metadata schema. Par ameters hsp IN: The schema to interrogate. countp OUT: Updated with the number of name-value pairs in the schema. Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_INVALID_SCHEMA See Also “ hc_schema_get_type_at_index ” on page 62 hc_schema_get_ty[...]
-
Página 63
IN: Should range from 0 up to the count-1 returned in “ hc_schema_get_count ” on page 61 . namep OUT: Updated to point to a string that is an attribute name of one attribute in the schema. typep OUT: Updated to be the type associated with that name in the schema. I f the server schema references a type that the client library does not support, [...]
-
Página 64
▼ T o Use the API f or Storing Name - V alue Records Call hc_init once per pr ocess. Call “ hc_session_create_ez ” on page 53 t o initialize the session and download the schema. Create the metada ta record with “ hc_nvr_create ” on page 65 . Fill the new metada ta piece by piece with hc_nvr_add_metadata_* functions (see “Building Name -[...]
-
Página 65
Crea ting and Fr eeing Name -V alue Records The following functions are dened to create and free name-value records: ■ “ hc_nvr_create ” on page 65 ■ “ hc_nvr_free ” on page 66 hc_nvr_create Creates a name-value record. Synopsis hcerr_t hc_nvr_create(hc_session_t *session, hc_long_t nslots, hc_nvr_t **nvrp); Description This function[...]
-
Página 66
See Also “ hc_nvr_free ” on page 66 hc_nvr_free Frees a name-value record. Synopsis hcerr_t hc_nvr_free(hc_nvr_t *nvr); Description This function frees a name-value record that was created by “ hc_nvr_create ” on page 65 . Par ameter nvr IN: P oints to the name-value-record to be freed. Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCER[...]
-
Página 67
■ “ hc_nvr_add_timestamp ” on page 74 ■ “ hc_nvr_add_from_string ” on page 75 hc_nvr_add_value A dds a new metadata value. Synopsis hcerr_t hc_nvr_add_value(hc_nvr_t *nvr, char *name, hc_value_t value); Description This function adds a new metadata name-value-type tuple to a designated name-value record. The name-value record will autom[...]
-
Página 68
hc_nvr_add_long A dds a new metadata value of type hc_long_t . Synopsis hcerr_t hc_nvr_add_long(hc_nvr_t *nvr, char *name, hc_long_t value) Description This function adds a new metadata name-value-type tuple to a designated name-value record, where type is known to be hc_long_t (see “ hc_type_t ” on page 47 ). The name-value record will automat[...]
-
Página 69
hc_nvr_add_double A dds a new metadata value of type hc_double_t . Synopsis hcerr_t hc_nvr_add_double(hc_nvr_t *nvr, char *name, hc_double_t value); Description This function adds a new metadata name-value-type tuple to a designated name-value record, where type is known to be hc_double_t (see “ hc_type_t ” on page 47 ). The name-value record w[...]
-
Página 70
hc_nvr_add_string A dds a new metadata value of type Unicode UTF-8 string. Synopsis hcerr_t hc_nvr_add_string(hc_nvr_t *nvr, char *name, hc_string_t value); Description This function adds a new metadata name-value-type tuple to a designated name-value record, where type is a Unicode UTF-8 string. The name-value record automatically expands as neede[...]
-
Página 71
hc_nvr_add_binary A dds new metadata value of type binary . Synopsis hcerr_t hc_nvr_add_binary(hc_nvr_t *nvr, hc_string_t name, int size, unsigned char *bytes); Description This function adds a new metadata name-value-type tuple to a designated name-value record, where type is binary data. The name-value record automatically expands as needed. The [...]
-
Página 72
hc_nvr_add_date A dds new metadata value of type date . Synopsis #include <time.h> hcerr_t hc_nvr_add_date(hc_nvr_t *nvr, hc_string_t name,struct tm *value); Description This function adds a new metadata name-value-type tuple to a designated name-value record. The struct tm elds are as dened in the POSIX standard and interpreted by mkti[...]
-
Página 73
hc_nvr_add_time A dds new metadata value of type time . Synopsis #include <time.h> hcerr_t hc_nvr_add_time(hc_nvr_t *nvr, hc_string_t name, time_t *value); Description This function adds a new metadata name-value-type tuple to a designated name-value record. The value represents seconds since midnight. The name-value record automatically expa[...]
-
Página 74
hc_nvr_add_timestamp A dds new metadata value of type timestamp . Synopsis #include <time.h> hcerr_t hc_nvr_add_timestamp(hc_nvr_t *nvr, hc_string_t name, struct timespec *value); Description This function adds a new metadata name-value-type tuple to a designated name-value record, where type is hc_timestamp_t . The struct timespec is dene[...]
-
Página 75
hc_nvr_add_from_string A dds a new metadata value where the value always starts out as a string. Synopsis hcerr_t hc_nvr_add_from_string(hc_nvr_t *nvr, char *name, char *value); Description This is a convenient function for adding a new metadata name-value-type tuple to a designated name-value, where the value always starts out as a string. The cor[...]
-
Página 76
Retrieving Name - V alue Records The following functions are dened to retrieve name-value records: ■ “ hc_nvr_get_count ” on page 76 ■ “ hc_nvr_get_value_at_index ” on page 77 ■ “ hc_nvr_get_long ” on page 78 ■ “ hc_nvr_get_double ” on page 79 ■ “ hc_nvr_get_string ” on page 80 ■ “ hc_nvr_get_binary ” on page [...]
-
Página 77
hc_nvr_get_value_at_index I terates through the names and values in a name-value record. Synopsis hc_nvr_get_value_at_index(hc_nvr_t *nvr, hc_long_t index, char **namep, hc_value_t *valuep); Description This function iterates through the names and values in a name-value record. The returned names are read-only. Unpredictable results will occur if e[...]
-
Página 78
hc_nvr_get_long Retrieves a value of type hc_long_t . Synopsis hcerr_t hc_nvr_get_long(hc_nvr_t *nvr, char *name, hc_long_t *retlong); Description This function retrieves the value of type hc_long_t (see “ hc_type_t ” on page 47 ) associated with an indicated attribute name in a name-value record. Par ameters nvr P oints to a name-value-record.[...]
-
Página 79
hc_nvr_get_double Retrieves a value of type hc_double_t . Synopsis hcerr_t hc_nvr_get_double(hc_nvr_t *nvr, char *name, hc_double_t *retdouble); Description This function retrieves the value of type hc_double_ t (see “ hc_type_t ” on page 47 ) associated with an indicated attribute name in a name-value record. Par ameters nvr P oints to a name-[...]
-
Página 80
hc_nvr_get_string Retrieves a value of a Unicode UTF-8 string. Synopsis hcerr_t hc_nvr_get_string(hc_nvr_t *nvr, char *name, hc_string_t *retstring); Description This function retrieves the value of a Unicode UTF-8 string associated with an indicated attribute name in a name-value record. N ote that the memory pointed to will be freed when the reco[...]
-
Página 81
hc_nvr_get_binary Retrieves a metadata value of type binary . Synopsis hcerr_t hc_nvr_get_binary(hc_nvr_t *nvr, hc_string_t name, int *size, unsigned char **bytes); This function retrieves the value of type binary associated with an indicated attribute name in a name-value record. The binary data is not copied and is freed when the name-value recor[...]
-
Página 82
hc_nvr_get_date Retrieves metadata value of type date . Synopsis #include <time.h> hcerr_t hc_nvr_get_date(hc_nvr_t *nvr, hc_string_t name, struct tm *value); Description This function retrieves the value of type struct tm associated with an indicated attribute name in a name-value record. Par ameters nvr P oints to a name-value-record. name [...]
-
Página 83
Synopsis #include <time.h> hcerr_t hc_nvr_get_time(hc_nvr_t *nvr, hc_string_t name, time_t *value); This function retrieves the value of type time_t (seconds since midnight) associated with an indicated attribute name in a name-value record. Par ameters nvr P oints to a name-value-record. name IN: N ame for the tuple. value OUT: Updated with [...]
-
Página 84
This function retrieves the value of type struct timespec associated with an indicated attribute name in a name-value record. Par ameters nvr P oints to a name-value-record. name IN: N ame for the tuple. value OUT: Updated with the struct timespec ( time.h ) value. Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_INVALID_NVR HCERR_ILLEGAL_AR[...]
-
Página 85
char **names, char **values, hc_long_t nitems); Description This function creates a name-value-record from parallel tables of string names and string values. The correct metadata type for each name must be looked up from the schema associated with this session. The name-value record will automatically expand as needed. The names and data values are[...]
-
Página 86
hc_nvr_convert_to_string_arrays Converts name-value-record to string names and string values. Synopsis hcerr_t hc_nvr_convert_to_string_arrays(hc_nvr_t *nvr, char ***namesp, char ***valuesp, int *nitemsp); Description This function converts a name-value-record into parallel tables of string names and string values. This destructively modies the [...]
-
Página 87
HCERR_OOM HCERR_INVALID_NVR HCERR_ILLEGAL_ARGUMENT Storing Da ta and Metadata The following functions are dened to store data and metadata and to enforce indexing of metadata where necessary: ■ “ hc_store_both_ez ” on page 87 ■ “ hc_store_metadata_ez ” on page 88 ■ “ hc_check_indexed_ez ” on page 89 Note – The is_indexed valu[...]
-
Página 88
Par ameters session IN: The session for the host and port to talk to. data_source_reader IN: The source of data to be stored. See “ read_from_data_source ” on page 49 . cookie IN: An opaque data structure (cookie) to be provided to data_source_reader . For example, this could be a le descriptor. nvr IN: P ointer to a name-value record with t[...]
-
Página 89
Description This function adds a metadata record for the specied OID and returns a system_record descriptor. Par ameters session IN: The session for the host and port to talk to. oid IN: An identier of object data to which the metadata record is attached. nvr IN: P ointer to a name-value record with the metadata. system_record OUT: Returned d[...]
-
Página 90
Description checkIndexed is intended as way to resolve a store index exception under program control (see “The 5800 System Query Integrity M odel” on page 21 ). Once a store index exception occurs (as indicated by a non-zero value of the is_indexed eld in the hc_system_record_t returned from a store operation) then hc_check_indexed_ez can be[...]
-
Página 91
Retrieving Da ta and Metadata The following functions are dened to retrieve data and metadata: ■ “ hc_retrieve_ez ” on page 91 ■ “ hc_retrieve_metadata_ez ” on page 92 ■ “ hc_range_retrieve_ez ” on page 93 hc_retrieve_ez Retrieves data for the specied OID . Synopsis hcerr_t hc_retrieve_ez(hc_session_t *session, *data_writer,[...]
-
Página 92
HCERR_OOM HCERR_NULL_SESSION HCERR_INVALID_SESSION HCERR_INVALID_OID hc_retrieve_metadata_ez Retrieves a metadata record for the specied OID . Synopsis hcerr_t hc_retrieve_metadata_ez (hc_session_t *session, hc_oid *oid, hv_nvr_t **nvrp); Description This function retrieves a metadata record for the specied OID . When it has nished, you sh[...]
-
Página 93
hc_range_retrieve_ez Retrieves a specied range of data for a specied OID . Synopsis hc_range_retrieve_ez(hc_session_t *session, write_to_data_destination data_writer, void *cookie, hc_oid *oid, hc_long_t; firstbyte, hc_long_t lastbyte); Description This function retrieves a specied range of data for a specied OID . Par ameters session I[...]
-
Página 94
HCERR_NULL_SESSION HCERR_INVALID_SESSION HCERR_INVALID_OID HCERR_ILLEGAL_ARGUMENT Quer ying Metadata The following functions are dened for simple queries: ■ “ hc_query_ez ” on page 94 ■ “ hc_qrs_next_ez ” on page 96 ■ “ hc_qrs_is_query_complete ” on page 97 ■ “ hc_qrs_get_query_integrity_time ” on page 98 ■ “ hc_qrs_f[...]
-
Página 95
int results_per_fetch, hc_query_result_set_t **rsetp); Description This function retrieves OIDs and optionally name-value records matching a query. I f the selects list is NULL , only OIDs are retrieved. I f selects is not NULL , name-value records are also retrieved and should each be freed using “ hc_nvr_free ” on page 66 . In both cases the [...]
-
Página 96
Return Codes HCERR_OK HCERR_OOM HCERR_BAD_REQUEST HCERR_NULL_SESSION HCERR_INVALID_SESSION HCERR_ILLEGAL_ARGUMENT See Also “ hc_qrs_free ” on page 99 hc_qrs_next_ez Fetches the next O ID and optionally name-value record from the QueryResultSet . Synopsis hcerr_t hc_qrs_next_ez(**rset, hc_oid *oid, hc_nvr_t **nvrp, int *finishedp); Description T[...]
-
Página 97
finishedp OUT: P oints to an int that is updated to 0 if query data has been returned and to 1 if the result set is empty. Return Codes HCERR_OK HCERR_OOM HCERR_BAD_REQUEST HCERR_INVALID_RESULT_SET HCERR_ILLEGAL_ARGUMENT hc_qrs_is_query_complete Indicates whether results of this query are complete in the sense that all objects that match the query,[...]
-
Página 98
Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_INVALID_RESULT_SET hc_qrs_get_query_integrity_time Returns a time that helps get more detail on which store index exceptions might still be unresolved. Synopsis hcerr_t hc_qrs_get_query_integrity_time(hc_query_result_set_t *rset, hc_long_t *query_timep); Description If the query integrity time[...]
-
Página 99
HCERR_OOM HCERR_INVALID_RESULT_SET hc_qrs_free Releases the resources associated with this QueryResultSet . Synopsis hcerr_t hc_qrs_free (**rsetp); Description This function releases the resources associated with this QueryResultSet . Note – When a query is incorrect and elicits an error from the server, the error is often reported after hc_qrs_f[...]
-
Página 100
hc_pstmt_create Creates an “ hc_pstmt_t ” on page 49 for use with the “ hc_pstmt_query_ez ” on page 109 function. Synopsis hcerr_t hc_pstmt_create(hc_session_t *session, hc_string_t query, hc_pstmt_t **ptr); Description This function creates a prepared statement for use with the “ hc_pstmt_query_ez ” on page 109 function. Par ameters se[...]
-
Página 101
hc_pstmt_free Frees a “ hc_pstmt_t ” on page 49 with all its bindings. Synopsis hcerr_t hc_pstmt_free(hc_pstmt_t *pstmt); Description This function frees a prepared statement. Par ameters pstmt Prepared statement to be freed. Return Codes HCERR_OK See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_string A dds a string binding to a “ h[...]
-
Página 102
Par ameters pstmt Prepared statement to add the binding to. which IN: Variable (” ? ’) in the prepared statement, numbered from 1 . value IN: String to bind. Return Codes HCERR_OK HCERR_OOM See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_char A dds a char binding to a “ hc_pstmt_t ” on page 49 . Synopsis hcerr_t hc_pstmt_set_char([...]
-
Página 103
IN: Variable (” ? ’) in the prepared statement, numbered from 1 . value IN: char * string to bind. Return Codes HCERR_OK HCERR_OOM See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_double A dds a double precision binding to a “ hc_pstmt_t ” on page 49 . Synopsis hcerr_t hc_pstmt_set_double(hc_pstmt_t *pstmt, int which, hc_double_t v[...]
-
Página 104
Return Codes HCERR_OK HCERR_OOM See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_long A dds a “ hc_long_t ” on page 46 binding to a “ hc_pstmt_t ” on page 49 . Synopsis hcerr_t hc_pstmt_set_long(hc_pstmt_t *pstmt, int which, hc_long_t value); Description This function binds an “ hc_long_t ” on page 46 to one of the variables in[...]
-
Página 105
See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_date A dds a date binding to a “ hc_pstmt_t ” on page 49 . Synopsis #include <time.h> hcerr_t hc_pstmt_set_date(hc_pstmt_t *pstmt, int which, struct tm *value); Description This function binds a date in the form of the POSIX struct to one of the variables in a prepared statement. T[...]
-
Página 106
See Also “ hc_pstmt_create ” on page 100 hc_pstmt_set_time A dds a time-of-day binding to a “ hc_pstmt_t ” on page 49 . Synopsis #include <time.h> hcerr_t hc_pstmt_set_time(hc_pstmt_t *pstmt, int which, time_t *value); Description This function binds a time of day in seconds to one of the variables in a prepared statement. The variabl[...]
-
Página 107
hc_pstmt_set_timestamp A dds a timestamp binding to a “ hc_pstmt_t ” on page 49 . Synopsis #include <time.h> hcerr_t hc_pstmt_set_timestamp(hc_pstmt_t *pstmt, int which, struct timespec *value); Description This function binds a timestamp in the form of the POSIX struct timespec to one of the variables in a prepared statement. The variabl[...]
-
Página 108
hc_pstmt_set_binary A dds a binary binding to a “ hc_pstmt_t ” on page 49 . Synopsis hcerr_t hc_pstmt_set_binary(hc_pstmt_t *pstmt, int which, unsigned char *data,int size); Description This function binds a binary array to one of the variables in a prepared statement. The variable must be of the appropriate type in the database. Errors in bind[...]
-
Página 109
hc_pstmt_query_ez Retrieves OIDs and optionally name-value records matching a prepared statement. Synopsis hcerr_t hc_pstmt_query_ez(*pstmt,hc_string_t selects[], int n_selects, int results_per_fetch, hc_query_result_set_t **rsetp); Description This function retrieves OIDs and optionally name-value records matching a prepared statement. “ hc_qrs_[...]
-
Página 110
Return Codes HCERR_OK HCERR_OOM HCERR_BAD_REQUEST HCERR_NULL_SESSION HCERR_INVALID_SESSION HCERR_ILLEGAL_ARGUMENT See Also “ hc_pstmt_create ” on page 100 Quer ying W ith a Pr epared Stat ement The following code is an example of querying with a prepared statement. Error handling is omitted. Two metadata elds are used with the denitions f[...]
-
Página 111
// list all OIDs from yesterday with test_status t = 86400; // 86400 sec/day date = gmtime(&t); res = hc_pstmt_set_date(pstmt, 1, date); res = hc_pstmt_query_ez(pstmt, selects, 1, 2000, &rset); while (1) { hc_oid oid; hc_nvr_t *nvr int finished; hc_string_t test_status; res = hc_qrs_next_ez(rset, &oid, &nvr, &finished); if (fini[...]
-
Página 112
Par ameters session IN: P ointer to the session. oid IN: The specied OID . Return Codes HCERR_OK HCERR_BAD_REQUEST HCERR_OOM HCERR_NULL_SESSION HCERR_INVALID_SESSION HCERR_INVALID_OID T ranslating Err or and T ype Codes The following functions are dened for translating error codes and type codes into strings: ■ “ hc_decode_hcerr ” on pa[...]
-
Página 113
hc_decode_hc_type Translates a type code into a string. Synopsis char *hc_decode_hc_type(hc_type_t type); Description Translates a type code into a string. Par ameters type IN: The type code to translate. Querying W ith a Prepared Stat ement Chapter 3 • Sun Storage T ek 5800 System C Client API 113[...]
-
Página 114
114[...]
-
Página 115
Sun Storage T ek 5800 Syst em Quer y Language This chapter provides information on the 5800 system query language. Note – For details of the metadata system and how it is congured, see Chapter 8, “Conguring M etadata and Virtual File System Views” in Sun StorageTek 5800 Storage System A dministration Guide . The following topics are dis[...]
-
Página 116
Opera tion The query format is similar to the where clause of an SQL query. The two main dierences are that 5800 system queries do not contain embedded subqueries, and that the only “columns” that are available are the attributes dened in the 5800 system schema. Many features of the underlying metadata database’ s own query language can[...]
-
Página 117
Queries A query in the 5800 system query language is translated into an equivalent query for the underlying database that implements the query engine. The database used in a live 5800 system is Sun's High A vailability Database (H ADB). The database used by the 5800 system emulator is A pache TM Derby. Since the SQL query language used by H AD[...]
-
Página 118
SQL Syntax in 5800 S ystem Queries General Unicode characters outside of the ASCII range in queries are allowed in only two places to the 5800 system. Specically, both attribute names and literal values may contain general Unicode characters. All text that is not either an attribute name nor a literal value is passed unchanged to the underlying [...]
-
Página 119
Liter als for 5800 S yst em Data T ypes For each 5800 system data type, there is a syntax to include literals of that type in a query string. The syntax is {type_name ’ stringliteral ’ } . For example, consider the query: timestamp_field<{timestamp ’ 2006-10-26T12:00:00Z ’ } In particular, this syntax can be used to query for a particula[...]
-
Página 120
■ When converting a typed value to a string as the result of the getAsString operation on a NameValueRecord or a QueryResultSet operation ■ When parsing a literal value as described in “Literals for 5800 System Data Types” on page 119 to create a typed query value from a string representation of that value. The C anonical String Decode Oper[...]
-
Página 121
■ The following JDBC function escapes supported: TIMESTAMPDIFF, TIMESTAMPADD, CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_DATE, HOUR, MINUTE, SECOND . Reser ved W ords Some SQL reserved words (such as BETWEEN or LIKE ) are allowed in queries and are expected to occur. An SQL reserved word cannot be used as an attribute name unless it is enclosed in [...]
-
Página 122
■ expr [NOT] IN (valueslist) . Note – The 5800 system emulator supports (but the cluster database does not) a JDBC “escape” clause that allows you to treat either % or _ as constant characters. There is currently no way to accomplish this in a LIKE clause in a query on a live cluster. ■ The following JDBC function escapes have been tested[...]
-
Página 123
Examples of Suppor ted Quer y Expressions ■ {fn LCASE(mp3.artist)} LIKE ’ %floyd% ’ AND system.object_size > 2000000 ■ (object_size < 200) OR " Collation " = ’ en-US ’ ■ {fn TIMESTAMPDIFF(SQL_TSI_YEAR, system.test.type_timestamp, ’ 2007-04-02 01:50:50.999 ’ ) }<3 ■ {fn TIMESTAMPADD(SQL_TSI_YEAR, 2, system.test[...]
-
Página 124
■ SIN(float) ■ SQRT(float) ■ TAN(float) SQL W ords T hat Ar e Allow ed in Queries Some SQL reserved words (such as BETWEEN or LIKE ) are allowed in queries and are expected to occur. An SQL reserved word cannot be used as an attribute name unless it is enclosed in double quotes (for example, " FIRST " ) . The following reserved word[...]
-
Página 125
DEALLOCATE, DECLARE, DEFAULT, DEFERRABLE, DEFERRED, DELETE, DESC, DESCRIBE, DESCRIPTOR, DETERMINISTIC, DIAGNOSTICS, DIRECTORY, DISCONNECT, DISTINCT, DO, DOMAIN, DOUBLEATTRIBUTE, DROP, EACH, EXCEPT, EXCEPTION, EXEC, EXECUTE, EXTERNAL, FETCH, FLOAT, FOREIGN, FOUND, FULL, FUNCTION, GET, GLOBAL, GO, GOTO, GRANT, GROUP, HANDLER, HAVING, IDENTITY, IMMEDI[...]
-
Página 126
126[...]
-
Página 127
P rogramming C onsiderations and Best P rac tices This chapter provides considerations and practices that can help you create ecient 5800 system applications. The following topics are discussed: ■ “Retries and Timeouts” on page 127 ■ “Query Size Limit” on page 127 ■ “Limit the Size of Schema Query Parameters and Literals” on pa[...]
-
Página 128
eld consumes the same number of bytes as the length of the value. A string value consumes twice as many bytes as the length of the value. These sizes are similar to what is described in the Sun StorageTek 5800 System A dministration Guide , Table 7-6, N umber of Bytes Used by E ach Element Type in a Schema Table. For example, assume dynamic para[...]
-
Página 129
Index Numbers and Symbols 5800 system H oneycomb project, 17 summary, 16-17 B best practices max results per fetch, 128 retries and timeouts, 127 schema query size, 128 C C client API application deployment, 43 architecture, 40 failure and recovery, 43 hc_cleanup ,4 2 hc_init , 41-42 hc_system_record_t , 42-43 heap memory allocator, 41 deallocator,[...]
-
Página 130
data type, synchronous C API (Continued) hc_string_t ,4 6 hc_value_t , 47-48 hcerr_t , 51-53 read_from_data_source , 49-50 write_to_data_destination , 50-51 deleting, objects, overview, 22-23 E error codes list of, 51-53 translating into a string hc_decode_hcerr , 112 F fetches, limiting max results, 128 G getObjectIdentifier method, 37 getQueryInt[...]
-
Página 131
metadata (Continued) retrieving, 91 storing, 87 hc_store_both_ez , 87-88 metadata model, overview, 19-20 models data, 17-19 deleting objects, 22-23 metadata, 19-20 query, 20-21 query integrity, 21-22 multithreaded access, 40 N name-value records, 63 building, 66-67 hc_nvr_add_binary ,7 1 hc_nvr_add_date ,7 2 hc_nvr_add_double ,6 9 hc_nvr_add_from_s[...]
-
Página 132
OID (Continued) retrieve metadata for hc_retrieve_metadata_ez ,9 2 retrieve range of data for hc_range_retrieve_ez , 93-94 operations retrying, 26, 40 overview, 16-23 5800 system, 16-17 data model, 17-19 H oneycomb project, 17 metadata model, 19-20 query integrity model, 21-22 query model, 20-21 P prepared statement add binary binding to hc_pstmt_s[...]
-
Página 133
R retries, 127 retrieveMetadata method, 33 retrieveObject method, 33 retrying operations, 26, 40 S schema managing, 59-60 hc_schema_get_count , 61-62 hc_schema_get_length ,6 1 hc_schema_get_type ,6 0 hc_schema_get_type_at_index , 62-63 schema denitions, updating, 41 session management allocator_t ,4 1 deallocator_t ,4 1 failure and recovery, 43 [...]
-
Página 134
synchronous C API (Continued) error codes translating into a string, 112 fetch next OID hc_qrs_next_ez , 96-97 free prepared statement hc_pstmt_free , 101 functions, 53-110 hc_nvr_get_count ,7 6 hc_pstmt_create , 100 hc_pstmt_free , 101 hc_pstmt_query_ez , 109-110 hc_pstmt_set_binary , 108 hc_pstmt_set_char , 102-103 hc_pstmt_set_date , 105-106 hc_[...]
-
Página 135
T timeouts, 127 Index 135[...]
-
Página 136
136[...]