1 / 14

SRB API

SRB API. By: Roman Olschanowsky roman2u@sdsc.edu. SRB History. Started in 1995, joint venture with General Atomics 1.0 release in 1997 Code split in 2001 (version 1.1.8) Educational Version now: 3.3.1 Commercial Version: Nirvana SRB 2004 Nirvana Storage Division of GA

summer
Télécharger la présentation

SRB API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SRB API By: Roman Olschanowsky roman2u@sdsc.edu

  2. SRB History • Started in 1995, joint venture with General Atomics • 1.0 release in 1997 • Code split in 2001 (version 1.1.8) • Educational Version now: 3.3.1 • Commercial Version: • Nirvana SRB 2004 • Nirvana Storage Division of GA • www.nirvanastorage.com

  3. Available API to theStorage Resource Broker • Jargon – Java API and GUI (with src) • C, C++ – C and C++ API (with src) • Python – Python wrapped C API (with src) • unixIO – unix like IO calls (with src) • Matrix – WSDL/SOAP (with src) • Perl – Perl wrapped C API (contrib) • srbio – changes all unix IO to srb (contrib) • Semplar – MPI-IO API (contrib)

  4. When to add SRB API • Within computational code?, probably not • IO is usually not fast enough • Use SRB to get data to cluster • Run your code • Move partial results if you need to (local disk space) • Use SRB to write results • Most people use SRB API for interactive apps • Web pages • Portals • Viewer applications • Any app where local disk space is not big enough

  5. Many Projects have added SRB support • Kepler workflows kepler-project.org • Gridport portal framework gridport.net • Dspace digital library dspace.org • Telescience portal apps telescience.ucsd.edu • NMI package effortnsf-middleware.org • OMII package effort omii.ac.uk • Gridbus package effort gridbus.org

  6. C APIhttp://www.sdsc.edu/srb/CurrentSRB/Data_Han.doc srbConn* clConnect(char* srbHost, char* srbPort, char* srbAuth); int srbObjCreate(srbConn* conn, int catType, char *objID, char *dataTypeName, char *resourceName, char *collectionName, char *pathName, int dataSize); int srbFileOpen(srbConn* conn, int storSysType, char *hostAddr, char *filename, int flags, int mode); int srbFileRead(srbConn *conn, int fd, char *buf, int len); int srbFileWrite(srbConn *conn, int fd, char *buf, int len); int srbFileSeek(srbConn *conn, int fd, int offset, int whence); int srbFileStat(srbConn* conn, int storSysType, char *hostAddr,char *filename, struct srbStat *statbuf); int srbFileChmod(srbConn* conn, int storSysType, char *hostAddr, char *filename, int mode); int srbObjClose (srbConn* conn, int desc); void clFinish (srbConn* conn);

  7. Great Javadochttp://www.sdsc.edu/srb/jargon/doc/index.html

  8. Great Javadochttp://www.sdsc.edu/srb/jargon/doc/index.html

  9. Jargon SRB Java API (Connection) import edu.sdsc.grid.io.srb.*; import edu.sdsc.grid.io.*; import java.io.*; import java.net.URI; import java.util.*; . SRBAccount srbAccount = null; SRBFileSystem srbFileSystem = null; SRBFile srbFile = null; . SRBAccount.setVersion(SRBAccount.SRB_VERSION_3); srbAccount = new SRBAccount(host, port, username, password, homedir, domain, defaultResource); srbFileSystem = new SRBFileSystem( srbAccount );

  10. Jargon API (some basics) //Make a directory srbFile = new SRBFile( srbFileSystem, "mySRBJargonTestDir" ); srbFile.mkdir(); //Copy local file to SRB srbFile = new SRBFile( srbFile, "mySRBJargonTestFile" ); srbFile.copyFrom( localFile ); //Random access to a file in SRB srbRandomAccessFile = new SRBRandomAccessFile( srbFile, "rw" ); srbRandomAccessFile.seek( insertArea ); srbRandomAccessFile.write( new String(“Hello There").getBytes() ); srbRandomAccessFile.close(); // “Sls” listing String[] dirList = srbFile.list(); for(int i=0;i<dirList.length;i++) System.out.println(dirList[i]);

  11. Jargon API (some basics) //Replicate a file srbFile.replicate( “test-unix” ); //Add read permissions for npaci group srbFile.changePermissions( “r”, “npaci”, “groups” ); // setting metadata String[][] definableMetaDataValues = new String[1][2]; definableMetaDataValues[0][0] = "zxcv"; definableMetaDataValues[0][1] = "123"; MetaDataTable metaDataTable = new MetaDataTable( operators, definableMetaDataValues ); rl = new MetaDataRecordList[1]; rl[0] = new SRBMetaDataRecordList( SRBMetaDataSet.getField( SRBMetaDataSet.DEFINABLE_METADATA_FOR_FILES ), metaDataTable ); srbFile.modifyMetaData( rl[0] );

  12. Jargon API (some basics) //Query some metadata String[][] definableMetaDataValues = new String[1][2]; definableMetaDataValues[0][0] = "zxcv"; definableMetaDataValues[0][1] = "123"; int[] operators = new int[definableMetaDataValues.length]; operators[0] = MetaDataCondition.EQUAL; MetaDataTable metaDataTable = new MetaDataTable( operators, definableMetaDataValues ); conditions = new MetaDataCondition[1]; conditions[0] = MetaDataSet.newCondition( SRBMetaDataSet.DEFINABLE_METADATA_FOR_FILES, metaDataTable ); String[] selectFieldNames = {SRBMetaDataSet.FILE_NAME, SRBMetaDataSet.SIZE}; MetaDataSelect selects[] = MetaDataSet.newSelection( selectFieldNames ); selects[0] = MetaDataSet.newSelection( SRBMetaDataSet.DEFINABLE_METADATA_FOR_FILES ); selects[1] = MetaDataSet.newSelection( SRBMetaDataSet.DEFINABLE_METADATA_FOR_DIRECTORIES ); rl = fileSystem.query( conditions, selects );

  13. Java GUI components • Use whole GUI components in your apps! • Still a work in progress • For example: • A tree view component • A transfer progress panel • Will form a complete Java SRB Browser client

  14. Thanks! SRB handles large data and provides the ability to share and collaborate on distributed heterogeneous resources. Questions? www.sdsc.edu/srb srb@sdsc.edu

More Related