On 16/05/12 23:50, Simon Helsen wrote:
Andy,
I know you asked a while back about what API changes I had noticed. There
are a number of things that have changed since 2.6.3,
October 2010
most of them are
smaller and manageable (albeit annoying). Here a few examples:
1) DatasetGraphTDB subset = TDBFactory.createDatasetGraph();
now has to be
DatasetGraph subset = TDBFactory.createDatasetGraph();
DatasetGraphTDB is an internal class (and it's not DatasetGraphTDB now :-)
2) Another example is:
queryContext.setDataset(new DatasetImpl(subset));
now has to be
queryContext.setDataset(DatasetImpl.wrap(subset));
I don't understand this one - what's queryContext?
The only setDataset is on ExecutionContext in
com.hp.hpl.jena.sparql.engine
which is inside the engine and not an API call.
There is QueryExecutionFactory for creating a QueryExecution for dataset.
The call you want is
DatasetFactory.create(DatasetGraph)
DatasetImpl is, well, an Impl class.
3) TupleIndex newIndex = SetupTDB.makeTupleIndex(tmpLocation,
srcGraph.getConfig(), primary, name, name, indexRecordLen);
became
TupleIndex newIndex = SetupTDB.makeTupleIndex(tmpLocation, primary, name,
name, indexRecordLen);
Doing anything with internal classes is at your own risk!
4) More obscure is the following change:
SetupTDB.globalConfig.setProperty(Names.pBlockReadCacheSize,
blockReadCacheSize.toString());
SetupTDB is a wrapper to old code.
SystemParams has the constants as finals.
See SetupTDB for setting constant from properties.
You may wish to submit an enhancement if you want to manipulate cache
sizes in detail. It's been on the "it would be nice" list but it isn't
something many people need as they run on 64bit in production. I wonder
if parameters ought to be a related to location.
That does not work anymore. It is unclear where I can set this property
now. I could use help with this one
In general, API changes are unavoidable, but they should be documented
per release in a readme.
Simon
Andy