From: Paul G. <pa...@us...> - 2006-03-28 20:31:18
|
Update of /cvsroot/azureus/azureus2/org/gudy/azureus2/pluginsimpl/local/ddb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19090/org/gudy/azureus2/pluginsimpl/local/ddb Modified Files: DDBaseTTTorrent.java DDBaseImpl.java DDBaseValueImpl.java Log Message: added version Index: DDBaseValueImpl.java =================================================================== RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/pluginsimpl/local/ddb/DDBaseValueImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- DDBaseValueImpl.java 10 Feb 2006 03:42:45 -0000 1.5 +++ DDBaseValueImpl.java 28 Mar 2006 20:31:14 -0000 1.6 @@ -41,6 +41,7 @@ private byte[] value_bytes; private long creation_time; + private long version; // we reserve 3 bytes for overflow marker and length encoding for multi-value values @@ -50,13 +51,15 @@ DDBaseValueImpl( DDBaseContactImpl _contact, Object _value, - long _creation_time ) + long _creation_time, + long _version ) throws DistributedDatabaseException { contact = _contact; value = _value; creation_time = _creation_time; + version = _version; value_bytes = DDBaseHelpers.encode( value ); @@ -68,11 +71,13 @@ DDBaseValueImpl( DDBaseContactImpl _contact, byte[] _value_bytes, - long _creation_time ) + long _creation_time, + long _version ) { contact = _contact; value_bytes = _value_bytes; creation_time = _creation_time; + version = _version; } public Object @@ -101,6 +106,12 @@ return( creation_time ); } + public long + getVersion() + { + return( version ); + } + public DistributedDatabaseContact getContact() { Index: DDBaseImpl.java =================================================================== RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/pluginsimpl/local/ddb/DDBaseImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- DDBaseImpl.java 11 Mar 2006 20:18:04 -0000 1.28 +++ DDBaseImpl.java 28 Mar 2006 20:31:14 -0000 1.29 @@ -197,7 +197,7 @@ { throwIfNotAvailable(); - return( new DDBaseValueImpl( new DDBaseContactImpl( this, dht.getLocalAddress()), value, SystemTime.getCurrentTime())); + return( new DDBaseValueImpl( new DDBaseContactImpl( this, dht.getLocalAddress()), value, SystemTime.getCurrentTime(), -1)); } public DistributedDatabaseContact @@ -466,7 +466,7 @@ contact, type, new DDBaseKeyImpl( xfer_key ), - new DDBaseValueImpl( contact, value, SystemTime.getCurrentTime())); + new DDBaseValueImpl( contact, value, SystemTime.getCurrentTime(), -1)); }catch( Throwable e ){ @@ -540,7 +540,7 @@ return( null ); } - return( new DDBaseValueImpl( contact, data, SystemTime.getCurrentTime())); + return( new DDBaseValueImpl( contact, data, SystemTime.getCurrentTime(), -1)); } } @@ -619,7 +619,7 @@ System.arraycopy( value, pos, d, 0, len ); - listener.event( new dbEvent( type, key, originator, d, _value.getCreationTime())); + listener.event( new dbEvent( type, key, originator, d, _value.getCreationTime(), _value.getVersion())); pos += len; } @@ -699,7 +699,7 @@ contact = new DDBaseContactImpl( DDBaseImpl.this, _contact ); - value = new DDBaseValueImpl( contact, _value.getValue(), _value.getCreationTime()); + value = new DDBaseValueImpl( contact, _value.getValue(), _value.getCreationTime(), _value.getVersion()); } protected @@ -708,14 +708,15 @@ DistributedDatabaseKey _key, DHTPluginContact _contact, byte[] _value, - long _ct ) + long _ct, + long _v ) { type = _type; key = _key; contact = new DDBaseContactImpl( DDBaseImpl.this, _contact ); - value = new DDBaseValueImpl( contact, _value, _ct ); + value = new DDBaseValueImpl( contact, _value, _ct, _v ); } public int Index: DDBaseTTTorrent.java =================================================================== RCS file: /cvsroot/azureus/azureus2/org/gudy/azureus2/pluginsimpl/local/ddb/DDBaseTTTorrent.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- DDBaseTTTorrent.java 9 Mar 2006 08:35:28 -0000 1.11 +++ DDBaseTTTorrent.java 28 Mar 2006 20:31:14 -0000 1.12 @@ -268,7 +268,7 @@ return( null ); } - return( new DDBaseValueImpl( contact, data, SystemTime.getCurrentTime())); + return( new DDBaseValueImpl( contact, data, SystemTime.getCurrentTime(), -1)); } protected byte[] |