Home
Sun StorageTek 5800 System SDK Reference Manual
Contents
1. 28 Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications Query Queries a 5800 system server for metadata records that match the query string passed on the command line Note Query requires the T Z UTC format For example 1952 10 27T00 30 29 999Z Synopsis java Query lt IP HOST gt lt QUERY gt OPTIONS Description Queries for metadata records QUERY is of the form namel valuel AND lt name2 gt lt value2 gt OR See the examples below for formatting of various types of values The OID and any specified fields of metadata records that match the query are printed to stdout name should be specified in the format namespace attributes Note that names that are keywords need to be enclosed in escaped double quotes for example with the bash shell use name V value Refer to the list of keywords in Chapter 4 Sun StorageTek 5800 System Query Language in Sun StorageTek 5800 SystemClient API Reference Manual Options s FIELD Specifies a field to be retrieved much like an SQL select clause To retrieve multiple fields repeat this option By default the results are returned as a list of OIDs n number of results The maximum number of metadata records or OIDs that will be returned The default is 1000 h Print this message Examples In the following examples first is a keyword Chapter2 Example Applicatio
2. bat scripts for running the example applications are provided in the java scripts directory These scripts must be run from the java scripts directory The scripts illustrate the CLASSPATH environment variable required The jar files are in the java lib directory Note The usage messages printed by the applications omit the CLASSPATH environment variable for the sake of readability If you are running the example application without using the provided scripts then you must set the CLASSPATH environment variable manually Chapter2 Example Applications 19 Java Example Applications 20 Building the Java Example Applications To build the Java example applications go to the java examples directory and execute the master build sh script for Solaris and Linux environments or the master build bat script for Windows environments These scripts build the examples and put them in the honeycomb sdk jar archive located in the java Lib directory Running a Java Example Application Once you have built the Java example applications go to the java scripts directory and execute the sh scripts for Solaris and Linux environments or bat scripts for Windows environments Syntax script_name arguments See the scripts for details of how the applications are run About the Example Application Source Code The Java example applications are all simple applications that follow the same basic structure First Commandline parse is
3. 22 10 29 type timestamp timestamp 2010 10 20T23 30 29 123Z2 The Beatles AND mp3 album Abbey Road The Beatles s mp3 album s mp3 title system test type timestamp timestamp 1952 10 27T08 30 29 9992 Source Code c examples Query c Chapter2 Example Applications 43 C Example Applications 44 RetrieveSchema Prints metadata attributes to stdout Synopsis RetrieveSchema lt IP HOST gt OPTIONS Description Retrieves the schema from a 5800 system server printing it to stdout Options h Print this message Examples RetrieveSchema archivehost Source Code c examples RetrieveSchema c Sun StorageTek 5800 System SDK Reference Manual June 2008 gt CHAPTER 3 Sun StorageTek 5800 System Open Edition Software This chapter provides information on running the 5800 system open edition software Note For the 1 1 1 release the name of the 5800 system emulator was changed to the 5800 system open edition software The following topics are discussed Introduction to the Open Edition Software on page 45 Software Requirements on page 46 Open Edition Software Startup on page 46 Open Edition Software Shutdown on page 46 Schema Modification on page 46 Open Edition Software Event Log on page 47 Open Edition Software Configuration Settings on page 47 Introduction to the Open Edition Software The 5800 system open edition soft
4. can change TABLE3 1 Open Edition Software Configuration File Settings Settings Description honeycomb cell capacity megs size size is the amount of available storage in Mbytes for the open edition software The default is 500 Mbytes Note that the actual capacity is 80 of the value provided which enables the healing of a missing disk in the 5800 system healing is not implemented in the open edition software honeycomb protocol port port_number port_number is the port the open edition software will listen on For further information on the configuration file refer to the Sun StorageTek 5800 Administrators Guide Chapter 3 Sun StorageTek 5800 System Open Edition Software 47 48 Index A AddMetadata 18 C 39 40 Java 26 27 applications C API deployment 15 examples C 33 44 examples Java 19 examples summary 17 18 Java API deployment 15 attributes 14 C C example applications See example applications C Clibrary directory 15 CheckIndexed C 36 Java 23 configuration file open edition software 47 D data types 14 DeleteRecord 18 C 41 Java 28 emulator see open edition software 45 eventlog 47 example applications C AddMetadata 39 40 building 34 CheckIndexed 36 DeleteRecord 41 overview 33 Query 42 43 RetrieveData 37 RetrieveMetadata 38 RetrieveSchema 44 running 34 software requirements 13 source code 34 StoreFile 35 Java AddMetadata 26 2
5. 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 m system test type Long 123 java AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type double 1 23 java AddMetadata server 0200004f75ee01094cc13elldbbad000e081598324d000024d40200000000Q m system test type date 1952 10 27 java AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type time 23 30 29 26 Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications java AddMetadata server 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000E m system test type timestamp 1952 10 27 23 30 29 999 java AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m namel valuel m name2 value 2 Source Code java examples AddMetadata java Chapter 2 Example Applications 27 Java Example Applications DeleteRecord Deletes the Sun 5800 system metadata record associated with an OID Synopsis java DeleteRecord IP Host OID OPTIONS Description Deletes the record with the specified OID If this record is the only record pointing to the data the data will also be deleted Options v Print deleted OID to stdout h Print this message Examples java DeleteRecord server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 Source Code java examples DeleteRecord java
6. CheckIndexed Checks if the metadata for an object is present in the query engine and inserts it if not CheckIndexed on page 23 CheckIndexed on page 36 Ret rieveData Enables you to retrieve data from the 5800 system server by Object ID The data object is sent to standard output or toa file specified on the command line RetrieveData on page 24 RetrieveData on page 37 Ret rieveMetadata Enables you to retrieve a metadata record from the 5800 system server associated with the supplied OID The metadata record is printed to standard output RetrieveMetadata on page 25 RetrieveMetadata on page 38 AddMetadata Enables you to specify name value pairs from the command line to store on a 5800 system server as a metadata record AddMetadata on page 26 AddMetadata on page 39 DeleteRecord Deletes a record from the 5800 system server for an OID supplied on the command line DeleteRecord on page 28 DeleteRecord on page 41 Query Queries a 5800 system server for specified metadata The query string is provided on the command line Query can print out the results as a list of name value pairs or as a list of OIDs You can specify the maximum number of results returned Query on page 29 Query on page 42 RetrieveSchema Retrieves the schema from a 5800 system server printing it to standard output RetrieveSchema on page 31
7. RetrieveSchema on page 44 GetDate Gets the date GetDate on page 32 N A Java Example Applications 18 This section provides detailed information about the Java example applications provided with the 5800 system client SDK Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications Example Overview Included with the 5800 system SDK are several command line example applications that demonstrate the Java API The example applications are located in the SDK in the java examples directory These example applications come complete with a build script Before You Begin Make sure you configure your software environment before using the Java example applications m In Microsoft Windows 2003 Add C Program Files Java jdk_version bin to the PATH environment variable where jdk_version is the version for example jdk5 0 To edit the windows PATH environment variable Click the Start button Right click My Computer and select properties to launch System Properties Click the Advanced tab Click Environment Variables Under System Variables scroll down and click Path Click Edit to launch Edit System Variable Add the Java path name to the PATH environment variable Make certain each path name is separated by a semicolon 8 Click OK to close each window Iq y oe Sh s Also see Software Requirements on page 13 Running the Applications UNIX sh and Windows
8. appropriate 5800 system C API is then called Finally output is delivered back to either standard output a file or both Refer to the comments in the sample code for further details Example Applications The following C example applications are included with the 5800 system client SDK StoreFile on page 35 CheckIndexed on page 36 RetrieveData on page 37 RetrieveMetadata on page 38 AddMetadata on page 39 DeleteRecord on page 41 Query on page 42 RetrieveSchema on page 44 Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications StoreFile Stores a file and associated metadata on a 5800 system server Synopsis StoreFile lt IP HOST gt lt FILE gt OPTIONS Description Stores a file and its associated metadata record Ifno m options are specified a metadata record without user content is generated The OID of the metadata record is printed to stdout Options m lt name gt lt value gt Any number of m options can be specified Each option specifies a single name value pair lt name gt should be specified in the format lt namespace gt lt attribute gt Use double quotes if lt value gt is a string containing spaces h Print this message Examples StoreFile server var log messages StoreFile server journal StoreFile server myfile jpg m filesystem mimetype image jpeg StoreFile 10 152 0 12 myfile m system test type char do re mi Stor
9. called to parse the argument list Next the appropriate method in the NameValueObjectArchive class is called to communicate with the 5800 system server Finally output is delivered back to either standard output a file or both Refer to the comments in the sample code for further details Example Applications The following sections describe the Java example applications that are included with the 5800 system client SDK StoreFile on page 21 CheckIndexed on page 23 RetrieveData on page 24 Ret rieveMetadata on page 25 AddMetadata on page 26 DeleteRecord on page 28 Query on page 29 RetrieveSchema on page 31 GetDate on page 32 Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications StoreFile Stores a file and associated metadata to a 5800 system server Synopsis java StoreFile lt IP HOST gt lt FILE gt OPTIONS Description Stores a file and its associated metadata record Ifno m options are specified a metadata record without user content is generated The OID of the metadata record is printed to stdout Note StoreFile interprets the time in metadata arguments as local time zone unless the T Z format indicating UTC is used For example 1952 10 27T00 30 29 999Z Options m lt name gt lt value gt Any number of m options can be specified Each m option specifies a single name value pair lt name gt should
10. client machine including its time zone Synopsis java RetrieveMetadata lt IP HOST gt lt OID gt OPTIONS Description Retrieves a data record and metadata from the 5800 system server The metadata record identified by the supplied OID is printed to stdout Options h Printthis message Examples java RetrieveMetadata 10 152 0 12 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 Source Code java examples RetrieveMetadata java Chapter2 Example Applications 25 Java Example Applications AddMetadata Adds a metadata record to an already stored object Synopsis java AddMetadata IP HOST lt OID gt OPTIONS Description Adds a new metadata record to an existing data object Options m lt name gt lt value gt Any number of m options can be specified Each option specifies a single name value pair name should be specified in the format namespace attribute Use double quotes if value is a string containing spaces h Print this message Examples java AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m filesystem mimetype image jpeg java AddMetadata server 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 m system test type char do re mi java AddMetadata server 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 m system test type string fa so la java AddMetadata server
11. doe RIO d ro dre o d rodeada Example Overview addo ie rente e ero p e ROC HONO Ur glands 19 Before You Begin ond aNG oet dteedln i em uso dvd ben i RO Idi a 19 Contents Runnins the Applications o ceo tute erre rete D Ogre ele ODD HR Id 19 Building the Java Example Applications nn 20 Running a Java Example Application een 20 About the Example Application Source Code eerte 20 Example Applications etai ehem aaa dd ee thi denies 20 StOreELULe AA CheckIndexed RetrieveData RetrizeveMetadat a ro ooa o ove P OR ON ATO Da di e NX I GAL 25 AddMet dait a ac i oro m Perd o dere POE PRI ANAND GA Dig e oii DIES EUR IS NA 26 D T eReCOrdE Sen N NAAANINAG AA AINA BANANA GD Kana 28 QUE TYO Naa atat htnc tete AA n ELLO ETSI AG 29 REEPLEVES CHEM EP 31 zur C Example Applications Example Overview Jin NGANGA BUGA Before YOU Begin nn NNMAN NANANA NINA GA 33 Buildingthe C Example Applications pa as aient ina add ist 34 Runninga C Example Application 34 About the C Example Application Source Code siennes 34 Example Applications rece eene e BABABA 34 SCORER AA SE CERRUEAR 35 CheckIndexed RetrieveData RetraeveMetadaita dates ivi ieu ieri d e I RI IUE I E ES ID DUE Ee M EUIS 38 Dons 39 DELERERE COR cts Na Sn en en den none dns 41 QUE Kanina E AA NANA NAA A E ama Ea 42 R trieveSchema siistiin niie iiias irasi i rai aaie dase DA NAKDALANG NG 44 Sun StorageTek 5800 System Open Edition S
12. the application is deployed The LD_LIBRARY_PATH environment variable must be set accordingly for Unix systems In the Windows environment you must update the PATH environment variable Chapter 1 Introduction to the Sun StorageTek 5800 System Client SDK 15 16 gt CHAPTER 2 Example Applications This chapter provides information about the Java and C example applications that are provided with the 5800 system SDK The following topics are discussed Example Application Summary on page 17 Java Example Applications on page 18 C Example Applications on page 33 Example Application Summary Table 2 1 summarizes the Java and C example applications provided with the 5800 system SDK All code examples are command line applications For detailed information about the Java example applications see Java Example Applications on page 18 For detailed information about the C example applications see C Example Applications on page 33 TABLE 2 1 5800 system Client SDK Example Applications Application Java Version CVersion StoreFile Enables you to specify a file StoreFile on page21 StoreFile on page 35 from the command line to store on a 5800 system server as data You can also specify metadata to include with the file Java Example Applications TABLE 2 1 5800 system Client SDK Example Applications Continued Application Java Version CVersion
13. 5ee01094cc13elldbbad000e08159832d000024d40200000000 m namel valuel m name2 value 2 Source Code c examples AddMetadata c 40 Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications DeleteRecord Deletes a record associated with an OID Synopsis DeleteRecord lt IP HOST gt lt OID gt OPTIONS Description Deletes a record associated with an OID The OID specifies which record to delete The record consists of all metadata associated with the OID or the data if it is a data OID The OID itself becomes inaccessible If this OID is the last OID associated with the data the data is also deleted Options v Print deleted OID to stdout h Print this message Examples DeleteRecord server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 Source Code c examples DeleteRecord c Chapter2 Example Applications 41 C Example Applications 42 Query Queries a 5800 system server for metadata records that match the query string passed on the command line Note Query requires the T Z UTC format For example 1952 10 27T00 30 29 999Z Synopsis Query lt IP HOST gt lt QUERY gt OPTIONS Description Queries for metadata records QUERY is of the form namel valuel AND lt name2 gt lt value2 gt OR See the examples below for formatting of various types of values The OID and any specified fields of metadata records that match the query ar
14. 7 building 20 CheckIndexed 23 DeleteRecord 28 GetDate 32 overview 19 Query 29 30 RetrieveData 24 RetrieveMetadata 25 RetrieveSchema 31 running 20 software requirements 13 source code 20 49 Index example applications Java Continued StoreFile 21 22 G GetDate 18 Java 32 installation instructions 13 J Java example applications 19 M metadata schema 14 namespace definition of 14 o open edition software configuration file 47 event log 47 introduction 45 reconfiguring port 47 requirements 13 46 schema modification 46 47 setting storage size 47 shutdown 46 startup 46 operating systems supported 12 13 P PATH environment changing for Windows 19 Q Query 18 C 42 43 Java 29 30 query language 15 R RetrieveData 18 G 37 Java 24 RetrieveMetadata 18 C 38 Java 25 RetrieveSchema 18 C 44 Java 31 S schema activation 46 47 modification 46 47 SDK application deployment 15 components 12 example applications 17 18 installation instructions 13 open edition software 45 overview 11 12 software requirements 13 system requirements 12 13 terms ofuse 12 semantics 14 attributes 14 data and metadata 14 metadata schema 14 namespace 14 50 Sun StorageTek 5800 System SDK Reference Manual June 2008 Index software requirements 13 source code C summary 33 Java summary 20 StoreFile 17 18 G 35 Java 21 22 system req
15. ATION EST FOURNIE EN L ETAT ET TOUTES AUTRES CONDITIONS DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE A L APTITUDE A UNE UTILISATION PARTICULIERE OU A L ABSENCE DE CONTREFACON 080616 20490 Contents Preface RM 7 Introduction to the Sun StorageTek 5800 System Client SDK sss 11 Overview of the SDK SDK Termsof US aan KG ANAN NGANGA ea Re pier TARA SDK Components iss aa Rires rm tin ttu drea 12 Supported Operating Systems oisinkin iiie 12 Software Requirements NANANABIK ARIANA 13 Java API Software Requirements 220 quo aatia det eene inc redi epu david Me edid 13 C API Software Requirements uas enia heben enhn Din KGG 13 Open Edition Software Requirement sis 13 SDK Installation Instructions 5800 System Semantics Overview ses 14 Data and Metadata cs ioter tao ede a eed o a e e ea ore A dad 14 Metadata schema ana um Ur Up UH URN HIR UA diet 14 AtHIDULES e E 14 Namespace i occi NAKED cadet tiic i n icai d n a a dc dI AER RES 14 5800 System Query Language SDK Application Deployment Java ABI cscs dace nice i m ce EU e E OA XE EN ERNEUT AA Example Applications ooo RED ERE RR ERR Raa Example Application Summary Java Example Applications zt maa he e re
16. Sun StorageTek 5800 System SDK Reference Manual S gt SUN microsystems Sun Microsystems Inc 4150 Network Circle Santa Clara CA 95054 U S A Part No 820 4797 June 2008 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 In particular and without limitation these intellectual property rights may include one or more U S patents or pending patent applications in the U S and in other countries U S Government Rights Commercial software Government users are subject to the Sun Microsystems Inc standard license agreement and applicable provisions of the FAR and its supplements This distribution may include materials developed by third parties Parts of the product may be derived from Berkeley BSD systems licensed from the University of California UNIX is a registered trademark in the U S and other countries exclusively licensed through X Open Company Ltd Sun Sun Microsystems the Sun logo the Solaris logo the Java Coffee Cup logo docs sun com StorageTek Java and Solaris are trademarks or registered trademarks of Sun Microsystems Inc in the U S and other countries All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International Inc in the U S and other countries Product
17. a and File System View in Sun StorageTek 5800 System Administration Guide Once your XML schema file is complete stop the open edition software and run the metadata merge config sh script metadata merge config bat on Windows located in the bin directory This script takes one command line argument which is the full path to your XML schema file The open edition software should be stopped while updating the schema To Activate a New Schema for the Open Edition Software Shut down the open edition software if it is currently running See Open Edition Software Shutdown on page 46 for details Run the metadata merge config program to activate the new schema Sun StorageTek 5800 System SDK Reference Manual June 2008 Open Edition Software Configuration Settings 3 Restart the open edition software See Open Edition Software Startup on page 46 for details Open Edition Software Event Log The open edition software event log is automatically stored under openedition logs emulator Log The event log contains all the transactions that the open edition software has processed as well as startup and shutdown information This log can be very helpful in debugging your 5800 system client applications Open Edition Software Configuration Settings You can configure the open edition software through the open edition software configuration file located at openedition config emulator config Table 3 1 provides the settings you
18. amming Interfaces APIs for the Java and C languages These APIs enable you to store and retrieve data and to store retrieve query and delete metadata records SDK Terms of Use For more information on the Java and C APIs refer to the Sun StorageTek 5800 SystemClient API Reference Manual Also see Chapter 2 Example Applications For known bugs see the Sun StorageTek 5800 System Release Notes SDK Terms of Use The 5800 system client SDK is released to you under the following copyright notice Copyright 2007 Sun Microsystems Inc All rights reserved Use is subject to license terms License terms are contained in the file StorageTek 5800 SLA amp Entitlement amp PRN txt in the top level directory of the installation Licence terms for embedded software are in the file LICENSE txt in the same directory SDK Components The 5800 system client SDK distribution includes a Java distribution Java examples and Java libraries a C distribution C examples and libraries and the 5800 system open edition software All parts of the SDK support Solaris Linux and Windows environments The Java and C example programs serve both as examples of how to program a client application and as generally useful utilities in their own right The contents of the zip archive include SDK Overview README html doc java c m openedition m StorageTek 5800 SLAGEntitlement amp PRN txt m LICENSE txt Supported Operating Sy
19. as follows C StorageTek500 SDK 1 1 82 c Win32 lib To edit the windows PATH environment variable 8 Si gx Murge he CEN Click the Start button Right click My Computer and select properties to launch System Properties Click the Advanced tab Click Environment Variables Under System Variables scroll down and click Path Click Edit to launch Edit System Variable Add the full path name of the SDK lib directory to the PATH environment variable Make certain each path name is separated by a semicolon Click OK to close each window Also see Software Requirements on page 13 Chapter2 Example Applications 33 C Example Applications 34 Building the C Example Applications To build the C example applications go to the c examples directory and run make This will build the example applications and put them in the c examples OS build directory Each C example application can be built separately by running make program_name Running aC Example Application Once you have built the C example applications go to the c examples 0S build directory and execute the binary file with the appropriate command line The examples depend on libhoneycomb so About the C Example Application Source Code First the function parseCommandline is called to parse the command line and store the information in a struct called Commandline Next any files that contain data to be sent to the 5800 system server are opened The
20. be specified in the format lt namespace gt lt attribute gt Use double quotes if lt value gt is a string containing spaces h Print this message Examples java StoreFile 10 152 0 12 myFile java StoreFile server myFile jpg m filesystem mimetype image jpeg java StoreFile server myFile m system test type char do re mi java StoreFile server myFile m system test type string fa so la java StoreFile server myFile m system test type long 123 java StoreFile server myFile m system test type double 1 23 java StoreFile server myFile m system test type binary 0789abcdef java StoreFile server myFile m system test type date 2010 10 20 Chapter2 Example Applications 21 Java Example Applications java StoreFile m system java StoreFile m system java StoreFile server myFile test type time 23 30 29 server myFile test type timestamp 2010 10 20 23 30 29 999 server myFile m namel valuel m name2 value 2 Source Code java examples StoreFile java 22 Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications CheckIndexed Ensure an object can be queried Checks if the metadata for an object is present in the query engine and inserts the metadata if it is not present Synopsis java CheckIndexed lt IP HOST gt lt OID gt OPTIONS Description Check with the 5800 systemserver to determine if the specified OID has become quer
21. c 4150 Network Circle Santa Clara CA 95054 U S A Tous droits r serv s Sun Microsystems Inc detient les droits de propri t intellectuelle relatifs a la technologie incorpor e dans le produit qui est d crit dans ce document En particulier et ce sans limitation ces droits de propri t intellectuelle peuvent inclure un ou plusieurs brevets am ricains ou des applications de brevet en attente aux Etats Unis et dans d autres pays Cette distribution peut comprendre des composants d velopp s par des tierces personnes Certaines composants de ce produit peuvent tre d riv es du logiciel Berkeley BSD licenci s par l Universit de Californie UNIX est une marque d pos e aux Etats Unis et dans d autres pays elle est licenci e exclusivement par X Open Company Ltd Sun Sun Microsystems le logo Sun le logo Solaris le logo Java Coffee Cup docs sun com StorageTek Java et Solaris sont des marques de fabrique ou des marques d pos es de Sun Microsystems Inc aux Etats Unis et dans d autres pays Toutes les marques SPARC sont utilis es sous licence et sont des marques de fabrique ou des marques d pos es de SPARC International Inc aux Etats Unis et dans d autres pays Les produits portant les marques SPARC sont bas s sur une architecture d velopp e par Sun Microsystems Inc L interface d utilisation graphique OPEN LOOK et Sun a t d velopp e par Sun Microsystems Inc pour ses utilisateurs et licenci s Sun reconna
22. c Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications RetrieveData Retrieves a data object from a 5800 system server Synopsis RetrieveData lt IP HOST gt lt OID gt lt FILE gt OPTIONS Description Retrieves data from the 5800 system The OID specifies what data to retrieve Data is written to FILE if specified otherwise to stdout Options h Print this message Examples RetrieveData storagetek 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 archive log 1 Source Code c examples RetrieveData c Chapter 2 Example Applications 37 C Example Applications 38 RetrieveMetadata Retrieves a metadata record from a specified 5800 system server Synopsis RetrieveMetadata lt IP HOST gt lt OID gt OPTIONS Description Retrieves metadata from the 5800 system The OID specifies what data to retrieve Metadata is printed to stdout Options h Print this message Examples RetrieveMetadata archivehost N 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 RetrieveMetadata 10 152 0 12 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 Source Code c examples RetrieveMetadata c Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications AddMetadata Adds a metadata record to an already stored object Synopsis AddMetadata lt IP HOST gt lt OID gt OPTIONS Descriptio
23. date Synopsis java GetDate lt IP HOST gt OPTIONS Description Gets the current date used to compute time setting and checking during store and delete operations Options h Print this message Examples java GetDate server Source Code java examples GetDate java 32 Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications C Example Applications This section provides detailed information on the C example applications provided with the 5800 system client SDK Example Overview Included with the 5800 system SDK are several command line example applications that demonstrate the use of the C API The example applications are located in the SDK under c examples Appropriate libraries are supplied for Solaris SPARC Solaris x86 Red Hat Linux and Windows Before You Begin Make sure you configure your software environment before using the C example applications In Solaris and Linux set the LD_LIBRARY_PATH environment variable to SDK directory name c OS Lib where SDK directory name is the root directory of the unzipped 5800 system SDK archive and OS is either Solaris or Linux For example StorageTek500 SDK 1 1 20 c Solaris lib In Microsoft Windows 2003 The example programs will run if they are run as installed in the default build directory However if you have moved them elsewhere the location of the library files DLLs must be added to the PATH environment variable
24. e printed to stdout lt name gt should be specified in the format lt namespace gt lt attribute gt Note that names that are keywords need to be enclosed in escaped double quotes for example with the bash shell use lt name gt lt value gt Refer to the list of keywords in Chapter 4 Sun StorageTek 5800 System Query Language in Sun StorageTek 5800 SystemClient API Reference Manual Options s lt FIELD gt Print out results as metadata name value records Use as many s switches as needed to define all fields that will be printed to stdout n lt number of results gt The maximum number of metadata records or OIDs that will be returned The default is 1000 h Print this message Examples In the following examples first is a keyword Sun StorageTek 5800 System SDK Reference Manual June 2008 C Example Applications Query Query Query Query Query Query Query Query Query Query Query Query Query archivehost archivehost archivehost archivehost archivehost archivehost archivehost archivehost archivehost archivehost 10 152 0 12 10 152 0 12 10 152 0 12 book author King firstV a system test system test system test system test system test type date 2010 10 20 system test system test mp3 artist mp3 artist system test type char do re mi type string fa so la type long 123 type double 1 23 type binary x 0789abcdef type time
25. eFile 10 152 0 12 myfile m system test type string fa so la StoreFile 10 152 0 12 myfile m system test type long 123 StoreFile 10 152 0 12 myfile m system test type double 1 23 StoreFile 10 152 0 12 myfile m system test type binary 0789abcdef StoreFile 10 152 0 12 myfile m system test type date 2010 10 20 StoreFile 10 152 0 12 myfile m system test type time 23 30 29 StoreFile 10 152 0 12 myfile m system test type timestamp 2010 10 20T23 30 29 999 StoreFile 10 152 0 12 myfile m namel valuel m name2 value 2 se Source Code c examples StoreFile c Chapter 2 Example Applications 35 C Example Applications 36 CheckIndexed Ensure an object is queryable Checks if the metadata for an object is present in the query engine and inserts the metadata if it is not present Synopsis CheckIndexed lt IP HOST gt lt OID gt OPTIONS Description Check with the 5800 systemserver to determine if the specified OID has become queryable If not attempt to make it queryable A short message about the supplied OID is printed to stdout Object OID was already queryable Object OID not yet queryable Object OID has now been made queryable Options h Print this message Examples CheckIndexed archivehost N 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 CheckIndexed 10 152 0 12 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 Source Code c examples CheckIndexed
26. mation on the valid data types that you can use when specifying attributes in a schema see Configuring Metadata and File System Views in Sun StorageTek 5800 System Administration Guide Namespace A namespace is a container that holds a set of typed attribute names Attribute names must be unique within a given namespace Defining a namespace is a way to organize and group together a set of related attribute names for a given application For more information see Configuring Metadata and File System Views in Sun StorageTek 5800 System Administration Guide Sun StorageTek 5800 System SDK Reference Manual June 2008 SDK Application Deployment 5800 System Query Language The 5800 system Java and C APIs both have a Query method that passes a query string to the 5800 system Queries are presented to the name value metadata cache For more information on the 5800 system query language see Chapter 4 Sun StorageTek 5800 System Query Language in Sun StorageTek 5800 SystemClient API Reference Manual SDK Application Deployment Java API You must deploy honeycomb client jar with any application using the Java API If you are using the SDK example applications you must also deploy honeycomb sdk jar C API The files in the Lib directory must be deployed with any application using the C API Different Lib directories exist for different operating systems You must use the correct Lib directory for the OS under which
27. n Adds a new metadata record to an existing data object Options m lt name gt lt value gt Any number of m options can be specified Each option specifies a single name value pair lt name gt should be specified in the format lt namespace gt lt attribute gt Use double quotes if lt value gt is a string containing spaces h Print this message Examples AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m filesystem mimetype image jpeg AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type char do re mi AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type string fa so la AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type Long 123 AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type double 1 23 AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type date 1992 10 27 AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type time 23 30 29 Chapter 2 Example Applications 39 C Example Applications AddMetadata server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 m system test type timestamp 1992 10 27T23 30 29 AddMetadata server 0200004f7
28. ns 29 Java Example Applications 30 java java java java java java java java java java java java Query Query Query Query Query Query Query Query Query Query Query Query se se 10 10 10 10 10 10 10 10 10 10 book author King mp3 artist The Beatles AND mp3 album Abbey Road mp3 artist The Beatles s mp3 album s mp3 title test test test type double 1 23 test test type time 23 30 29 type timestamp timestamp 2010 10 20T23 30 29 1237 test test test rver rver first a 152 0 12 152 0 12 152 0 12 system 152 0 12 system 152 0 12 system 152 0 12 system 152 0 12 system 152 0 12 system 152 0 12 system 152 0 12 system Source Code type_char do re mi type string fa so la type long 123 type binary x 0789abcdef type date 2010 10 20 java examples Query java Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications RetrieveSchema Returns the schema defined on a 5800 system server to standard output Synopsis java RetrieveSchema OPTIONS lt IP HOST gt Description Retrieves the metadata schema from a 5800 system server printing it to stdout Options h Print this message Examples java RetrieveSchema archivehost Source Code java examples RetrieveSchema java Chapter 2 Example Applications 31 Java Example Applications GetDate Gets the
29. oftware Introduction to the Open Edition Software seen Software Requirement PP M Open Edition Software Startup a eaa ec aNG G D cede o nit ur e BALAG 46 Open Edition Software Shutdown sise 46 Sun StorageTek 5800 System SDK Reference Manual June 2008 Contents Schema Modification esc dede gie npe m a b REO rir b i e ne E A serie p ess 46 V To Activate a New Schema for the Open Edition Software sees 46 Open Edition Software Event Log i25 nv taa n ate o Dado ide e ANG 47 Open Edition Software Configuration Settings sette 47 jl 49 Preface The Sun StorageTek 5800 System SDK Reference Manual is written for programmers and application developers This document along with the Sun StorageTek 5800 SystemClient API Reference Manual provides the information that you need in order to develop custom applications for the Sun StorageTek 5800 System How This Book Is Organized Chapter 1 Introduction to the Sun StorageTek 5800 System Client SDK provides an introduction to the Sun StorageTek 5800 System client Software Development Kit SDK and its components Chapter 2 Example Applications provides information about the Java and C example applications that are provided with the Sun StorageTek 5800 System SDK Chapter 3 Sun StorageTek 5800 System Open Edition Software provides information on running test client applications wi
30. our document with your feedback Sun StorageTek 5800 System SDK Reference Manual part number 820 4797 10 gt CHAPTER 1 Introduction to the Sun StorageTek 5800 System Client SDK This chapter provides an introduction to the Sun StorageTek 5800 System client Software Development Kit SDK and its components The following topics are discussed Overview of the SDK on page 11 SDK Terms of Use on page 12 SDK Components on page 12 Supported Operating Systems on page 12 Software Requirements on page 13 SDK Installation Instructions on page 13 5800 System Semantics Overview on page 14 5800 System Query Language on page 15 SDK Application Deployment on page 15 Overview of the SDK The 5800 system client SDK enables you to work with data and metadata stored on a 5800 system This document assumes that you have a basic understanding of how the 5800 system uses data and metadata For more information see 5800 System Semantics Overview on page 14 The SDK comes with open edition software that enables you to test client applications without having to connect to a 5800 system For further documentation on the open edition software see Chapter 3 Sun StorageTek 5800 System Open Edition Software Also refer to the Sun StorageTek 5800 System Administration Guide to better understand the type of server being emulated The SDK provides separate Application Progr
31. re used in this book TABLEP 1 Typographic Conventions Typeface Meaning Example AaBbCc123 The names of commands files and directories and onscreen computer output AaBbCc123 What you type contrasted with onscreen computer output aabbcc123 Placeholder replace with a real name or value Edit your Login file Use ls a to list all files machine names you have mail machine names su Password The command to remove a file is rm filename 8 Sun StorageTek 5800 System SDK Reference Manual June 2008 Preface TABLEP 1 Typographic Conventions Continued Typeface Meaning Example AaBbCc123 Book titles new terms and terms to be Read Chapter 6 in the User s Guide emphasized A cache is a copy that is stored locally Do not save the file Note Some emphasized items appear bold online Shell Prompts in Command Examples The following table shows the default UNIX system prompt and superuser prompt for the C shell Bourne shell and Korn shell TABLEP 2 Shell Prompts Shell Prompt C shell machine names C shell for superuser machine name Bourne shell and Korn shell Bourne shell and Korn shell for superuser Sun Welcomes Your Comments Sun is interested in improving its documentation and welcomes your comments and suggestions You can submit your comments by clicking the Feedback link on the http docs sun com web site Please include the title and part number of y
32. s Overview 14 This section provides an overview of 5800 system semantics Data and Metadata The 5800 system stores two types of data arbitrary object data and structured metadata records Every metadata record is associated with exactly one data object Every data object has at least one metadata record A unique object identifier OID is returned when a metadata record is stored The OID can later be used to retrieve the metadata record or its object data In addition metadata records can be retrieved by a query OID lt gt Metadata Record Object Data The two types of metadata are system metadata and user metadata The names and types of system metadata are predefined and cannot be overridden by the user Metadata Schema A user metadata record consists of a set of attributes The set of possible attributes is defined by the schema Only one schema exists for each 5800 system For information on configuring a schema see Configuring Metadata and File System Views in Sun StorageTek 5800 System Administration Guide The 5800 system open edition software loads its schema from an XML file The metadata_merge_config utility can be used to extend the default schema appending the new entries to the original schema which is then read by the open edition software For additional information see Chapter 2 Example Applications and Chapter 3 Sun StorageTek 5800 System Open Edition Software Attributes For infor
33. s bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems Inc The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems Inc for its users and licensees Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry Sun holds a non exclusive license from Xerox to the Xerox Graphical User Interface which license also covers Sun s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun s written license agreements Products covered by and information contained in this publication are controlled by U S Export Control laws and may be subject to the export or import laws in other countries Nuclear missile chemical or biological weapons or nuclear maritime end uses or end users whether direct or indirect are strictly prohibited Export or reexport to countries subject to U S embargo or to entities identified on U S export exclusion lists including but not limited to the denied persons and specially designated nationals lists is strictly prohibited DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS REPRESENTATIONS AND WARRANTIES INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT ARE DISCLAIMED EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID Copyright 2008 Sun Microsystems In
34. stems This release supports the following operating systems Red Hat Enterprise Linux 4 32 bit Red Hat Enterprise Linux 4 64 bit m Solaris 9 SPARC Solaris 10 SPARC Solaris 10 x64 and x86 12 Sun StorageTek 5800 System SDK Reference Manual June 2008 SDK Installation Instructions Windows 2003 Server 32 bit Software Requirements This release requires the following software For detailed software configuration information refer to the specific section or chapter in this book Java API Software Requirements The 5800 system Java API requires at minimum the JDK 5 0 software C API Software Requirements The 5800 system C API requires the following software m All platforms GNU make Perl m Solaris Sun Studio Linux gcc Windows 2003 server Microsoft Visual C Express Edition 2005 Microsoft Windows SDK Cygwin See http www cygwin com Open Edition Software Requirements The 5800 system open edition software requires at minimum the JDK 5 0 software SDK Installation Instructions The 5800 system SDK is compressed in a file with a name similar to StorageTek5800 SDK 1 1 20 zip where 1 1 20 refers to the version 1 1 and build number 20 This zip file expands into a directory StorageTek5800_SDK_1_1 20 which contains the entire SDK Chapter 1 Introduction to the Sun StorageTek 5800 System Client SDK 13 5800 System Semantics Overview 5800 System Semantic
35. t les efforts de pionniers de Xerox pour la recherche et le d veloppement du concept des interfaces d utilisation visuelle ou graphique pour l industrie de l informatique Sun d tient une licence non exclusive de Xerox sur l interface d utilisation graphique Xerox cette licence couvrant galement les licenci s de Sun qui mettent en place l interface d utilisation graphique OPEN LOOK et qui en outre se conforment aux licences crites de Sun Les produits qui font l objet de cette publication et les informations qu il contient sont r gis par la legislation am ricaine en mati re de contr le des exportations et peuvent tre soumis au droit d autres pays dans le domaine des exportations et importations Les utilisations finales ou utilisateurs finaux pour des armes nucl aires des missiles des armes chimiques ou biologiques ou pour le nucl aire maritime directement ou indirectement sont strictement interdites Les exportations ou r exportations vers des pays sous embargo des Etats Unis ou vers des entit s figurant sur les listes d exclusion d exportation am ricaines y compris mais de mani re non exclusive la liste de personnes qui font objet d un ordre de ne pas participer d une fa on directe ou indirecte aux exportations des produits ou des services qui sont r gis par la legislation am ricaine en mati re de contr le des exportations et la liste de ressortissants sp cifiquement design s sont rigoureusement interdites LA DOCUMENT
36. thout having to connect to a 5800 system Related Books Sun StorageTek 5800 System Regulatory and Safety Compliance Manual part number 819 3809 Sun StorageTek 5800 System Site Preparation Guide part number 820 1635 Sun StorageTek 5800 System Administration Guide part number 820 4118 Sun StorageTek 5800 System Client API Reference Manual part number 820 4796 Sun StorageTek 5800 System 1 1 1 Release Notes part number 820 4120 Preface Related Third Party Web Site References 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 materials that are available on or through such sites or resources Sun will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content goods or services that are available on or through such sites or resources Documentation Support and Training The Sun web site provides information about the following additional resources m Documentation http www sun com documentation m Support http www sun com support Training http www sun com training Typographic Conventions The following table describes the typographic conventions that a
37. uirements 12 13 W Windows PATH environment variable changing 19 51 52
38. ware mimics the behavior of a 5800 system server This feature enables you to test software being developed for a 5800 system without having to access a 5800 system server The open edition software stores all data and metadata on the local hard drive This data is by default stored in the openedition var directory 45 Software Requirements Software Requirements The 5800 system open edition software requires at minimum the JDK 1 5 software Open Edition Software Startup The 5800 system open edition software can run on Solaris Linux or Windows environments To start the open edition software go to the openedition bin directory and execute the start sh file for Solaris and Linux environments or the start bat file for the Windows environment The open edition software listens on port 8080 of the machine you start it on See Open Edition Software Configuration Settings on page 47 for directions on changing the port number Open Edition Software Shutdown Connect to port 8080 of the machine running the 5800 system open edition software with your web browser http localhost 8080 if you are on your local system Click on HttpContext admin then Click here to shutdown the open edition software Schema Modification 46 To add acustom schema to the 5800 system create an XML file detailing your custom schema Refer to the XML files in the config directory for examples of a custom schema Also see Configuring Metadat
39. yable If not attempt to make it queryable A short message about the supplied OID is printed to stdout Object OID was already queryable Object OID not yet queryable Object OID has now been made queryable Options h Print this message Examples java CheckIndexed server 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 java CheckIndexed 10 152 0 12 0200004f75ee01094cc13elldbbad000e08159832d000024d40200000000 Source Code java examples CheckIndex java Chapter2 Example Applications 23 Java Example Applications RetrieveData Retrieves data from a 5800 system server Synopsis java RetrieveData lt IP HOST gt lt OID gt FILE OPTIONS Description Retrieves data from the 5800 system The OID specifies what data to retrieve Data is written to FILE if specified otherwise to stdout Options h Print this message Examples java RetrieveData archivehost N 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 archive log 1 java RetrieveData 10 152 0 12 0200004f75ee01094cc13e11dbbad000e08159832d000024d40200000000 archive log 2 Source Code java examples RetrieveData java 24 Sun StorageTek 5800 System SDK Reference Manual June 2008 Java Example Applications RetrieveMetadata Retrieves metadata from the 5800 system The OID specifies what data to retrieve Note By default Ret rieveMetadata displays the time according to the configuration of the
Download Pdf Manuals
Related Search
Related Contents
LocationFree TV Manuel 超音波カッター 広報いせはら1032号 JUGSピツチングマシン等レンタル同憲賽 INSECICIDE 14 Table of contents AEQ PHOENIX MERCURY Copyright © All rights reserved.
Failed to retrieve file