SRB API - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

SRB API

Description:

Started in 1995, joint venture with General Atomics. 1.0 release in 1997 ... Matrix WSDL/SOAP (with src) Perl Perl wrapped C API (contrib) ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 15
Provided by: Rom566
Category:
Tags: api | srb | soap

less

Transcript and Presenter's Notes

Title: SRB API


1
SRB API
By Roman Olschanowsky roman2u_at_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 effort nsf-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 Javadoc http//www.sdsc.edu/srb/jargon/doc/
index.html
8
Great Javadoc http//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 i0iltdirList.lengthi)
  • System.out.println(dirListi)

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
    String12
  • definableMetaDataValues00 "zxcv"
  • definableMetaDataValues01 "123"
  • MetaDataTable metaDataTable new MetaDataTable(
    operators, definableMetaDataValues )
  • rl new MetaDataRecordList1
  • rl0 new SRBMetaDataRecordList(
    SRBMetaDataSet.getField( SRBMetaDataSet.DEFINABLE_
    METADATA_FOR_FILES ), metaDataTable )
  • srbFile.modifyMetaData( rl0 )

12
Jargon API (some basics)
  • //Query some metadata
  • String definableMetaDataValues new
    String12
  • definableMetaDataValues00 "zxcv"
  • definableMetaDataValues01 "123"
  • int operators new intdefinableMetaDataValues.
    length
  • operators0 MetaDataCondition.EQUAL
  • MetaDataTable metaDataTable new MetaDataTable(
    operators, definableMetaDataValues )
  • conditions new MetaDataCondition1
  • conditions0 MetaDataSet.newCondition(
    SRBMetaDataSet.DEFINABLE_METADATA_FOR_FILES,
    metaDataTable )
  • String selectFieldNames SRBMetaDataSet.FILE_N
    AME, SRBMetaDataSet.SIZE
  • MetaDataSelect selects MetaDataSet.newSelectio
    n( selectFieldNames )
  • selects0 MetaDataSet.newSelection(
    SRBMetaDataSet.DEFINABLE_METADATA_FOR_FILES )
  • selects1 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_at_sdsc.edu
Write a Comment
User Comments (0)
About PowerShow.com