7 modified files
lcio/doc
diff -u -r1.65.2.5 -r1.65.2.6
--- lcio.xml 28 May 2010 14:51:43 -0000 1.65.2.5
+++ lcio.xml 16 Jun 2010 15:30:19 -0000 1.65.2.6
@@ -38,6 +38,7 @@
<data type="long" name="firstRecordLocation">
For index record location of the first record associated with this block
</data>
+ <data type="int" name="recordSize"> ( 0xabcd0000 | sizeOfLCIORandomAccessRecord ) </data>
</block>
</record>
<record name="LCIOIndex">
lcio/sio/src
diff -u -r1.7.8.4 -r1.7.8.5
--- SIO_stream.cc 28 May 2010 14:51:43 -0000 1.7.8.4
+++ SIO_stream.cc 16 Jun 2010 15:30:20 -0000 1.7.8.5
@@ -1,5 +1,5 @@
// ----------------------------------------------------------------------------
-// CVS $Id: SIO_stream.cc,v 1.7.8.4 2010/05/28 14:51:43 gaede Exp $
+// CVS $Id: SIO_stream.cc,v 1.7.8.5 2010/06/16 15:30:20 gaede Exp $
// ----------------------------------------------------------------------------
// => Controller for a single SIO stream.
// ----------------------------------------------------------------------------
@@ -1266,6 +1266,12 @@
SIO_functions::copy( UCHR_CAST(&ucmp_length), (bufloc + ucmp_length_off),
SIO_LEN_QB, 1 );
+// //debug
+// std::cout << "*************** SIO: [" << name << "/" << rec_name << "/] "
+// << "writing record - compressed : " << compress
+// << std::endl;
+
+
//
// Write out the complete record.
//
lcio/src/cpp/include/SIO
diff -u -r1.18.4.3 -r1.18.4.4
--- LCSIO.h 30 Apr 2010 21:30:52 -0000 1.18.4.3
+++ LCSIO.h 16 Jun 2010 15:30:20 -0000 1.18.4.4
@@ -18,7 +18,7 @@
#define LCSIO_ACCESSRECORDNAME "LCIORandomAccess"
#define LCSIO_ACCESSBLOCKNAME "LCIORandomAccess"
-#define LCSIO_RANDOMACCESS_SIZE 132
+#define LCSIO_RANDOMACCESS_SIZE 136
#define LCSIO_INDEXRECORDNAME "LCIOIndex"
#define LCSIO_INDEXBLOCKNAME "LCIOIndex"
lcio/src/cpp/src/EXAMPLE
diff -u -r1.58 -r1.58.10.1
--- simjob.cc 9 Nov 2007 21:03:07 -0000 1.58
+++ simjob.cc 16 Jun 2010 15:30:20 -0000 1.58.10.1
@@ -65,14 +65,15 @@
if( argc > 1 ) { FILEN = argv[1] ; }
- lcWrt->setCompressionLevel( 0 ) ;
+ // lcWrt->setCompressionLevel(0 ) ;
if( rn==0 ){
- // lcWrt->setCompressionLevel( 0 ) ;
+ // turn off compression for first run ...
+ lcWrt->setCompressionLevel( 0 ) ;
lcWrt->open( FILEN , LCIO::WRITE_NEW ) ;
}else{
- // lcWrt->setCompressionLevel( 9 ) ;
+ lcWrt->setCompressionLevel( 9 ) ;
lcWrt->open( FILEN , LCIO::WRITE_APPEND ) ;
}
// NB: in order to test writing multiple files we create a new LCWriter
lcio/src/cpp/src/SIO
diff -u -r1.1.2.3 -r1.1.2.4
--- SIORandomAccessHandler.cc 30 Apr 2010 21:30:52 -0000 1.1.2.3
+++ SIORandomAccessHandler.cc 16 Jun 2010 15:30:20 -0000 1.1.2.4
@@ -48,6 +48,12 @@
SIO_DATA( stream , &( ra->_prevLocation) , 1 ) ;
SIO_DATA( stream , &( ra->_nextLocation) , 1 ) ;
SIO_DATA( stream , &( ra->_firstRecordLocation) , 1 ) ;
+
+
+ // read record size - ignored for now - need to read if record size changes in the future ...
+ int recSize ;
+ SIO_DATA( stream , &recSize , 1 ) ;
+
_raMgr->addLCIORandomAccess( ra ) ;
@@ -72,6 +78,11 @@
SIO_DATA( stream , &( ra->_nextLocation) , 1 ) ;
SIO_DATA( stream , &( ra->_firstRecordLocation) , 1 ) ;
+
+ // write the current size of the LCIORandomAccess record as last word - incl. check at bits 31-16: 0xabcd
+ int recSize = ( 0xabcd0000 | LCSIO_RANDOMACCESS_SIZE ) ;
+ SIO_DATA( stream , &recSize , 1 ) ;
+
}
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.1.2.4 -r1.1.2.5
--- RandomAccessBlock.java 9 Jun 2010 00:14:39 -0000 1.1.2.4
+++ RandomAccessBlock.java 16 Jun 2010 15:30:20 -0000 1.1.2.5
@@ -17,6 +17,9 @@
private static final String LCIORANDOMACCESS = "LCIORandomAccess";
private static final int minorVersion = LCIO.MINORVERSION;
private static final int majorVersion = LCIO.MAJORVERSION;
+
+ public static final int LCRANDOMACCESSRECORDSIZE = 136 ;
+
private static final RunEvent NOTSET = new RunEvent(0, 0);
private RunEvent minRunEvent = NOTSET;
private RunEvent maxRunEvent = NOTSET;
@@ -30,6 +33,7 @@
private long firstRecordLocation;
private SIOWriter writer;
+
RandomAccessBlock() {
}
@@ -61,6 +65,10 @@
sio.writeLong(previousAccessBlockLocation);
sio.writeLong(nextAccessBlockLocation);
sio.writeLong(firstRecordLocation);
+
+ // write the random access record size - with 0xabcd as 'check marker' in bits 31-16
+ sio.writeInt( 0xabcd0000 | LCRANDOMACCESSRECORDSIZE ) ;
+
sio.close();
}
@@ -80,6 +88,9 @@
previousAccessBlockLocation = sio.readLong();
nextAccessBlockLocation = sio.readLong();
firstRecordLocation = sio.readLong();
+
+ sio.readInt() ; // read record size - ignored for now ...
+
sio.close();
}
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.1.2.4 -r1.1.2.5
--- SIOLCRandomAccessReader.java 9 Jun 2010 00:14:39 -0000 1.1.2.4
+++ SIOLCRandomAccessReader.java 16 Jun 2010 15:30:20 -0000 1.1.2.5
@@ -28,7 +28,7 @@
// Peek at the last record to see if this file supports random access
try {
//FIXME: Should not hardwire record length
- SIORecord record = reader.readRecord(-132);
+ SIORecord record = reader.readRecord( - RandomAccessBlock.LCRANDOMACCESSRECORDSIZE );
if ("LCIORandomAccess".equals(record.getRecordName())) {
randomAccess = new FileRandomAccessSupport(reader, record);
}
@@ -49,7 +49,7 @@
for (String filename : filenames) {
SIOReader reader = new SIOReader(filename);
try {
- SIORecord record = reader.readRecord(-132);
+ SIORecord record = reader.readRecord( - RandomAccessBlock.LCRANDOMACCESSRECORDSIZE );
if (!"LCIORandomAccess".equals(record.getRecordName())) {
fileBlocks = null;
break;
CVSspam 0.2.8