int buffers, pageSize, cacheSize;
int buffers, cacheSize;
	public NativeBroker(BrokerPool pool, Configuration config) throws EXistException {		super(pool, config);		String dataDir;		int buffers, pageSize, cacheSize;		String temp;		boolean compress = false;		if ((dataDir = (String) config.getProperty("db-connection.data-dir")) == null)			dataDir = "data";		if ((pageSize = config.getInteger("db-connection.page-size")) < 0)			pageSize = 4096;		if ((buffers = config.getInteger("db-connection.buffers")) < 0)			buffers = BUFFERS;		if ((cacheSize = config.getInteger("db-connection.cache-size")) > 0) {			long totalMem = cacheSize * 1024 * 1024;			buffers = (int) (totalMem / pageSize / 64);		}		if ((defaultIndexDepth = config.getInteger("indexer.index-depth")) < 0)			defaultIndexDepth = 1;		if ((memMinFree = config.getInteger("db-connection.min_free_memory")) < 0)			memMinFree = 5000000;				Paged.setPageSize(pageSize);		String pathSep = System.getProperty("file.separator", "/");		int indexBuffers, dataBuffers;		try {			if ((elementsDb = (BFile) config.getProperty("db-connection.elements"))				== null) {				if ((indexBuffers = config.getInteger("db-connection.elements.buffers"))					< 0) {					indexBuffers = buffers * 4;					dataBuffers = buffers * 11;				} else					dataBuffers = indexBuffers >> 2;				LOG.debug(					"elements index buffer size: " + indexBuffers + "; " + dataBuffers);				elementsDb =					new BFile(						new File(dataDir + pathSep + "elements.dbx"),						indexBuffers,						dataBuffers);				if (!elementsDb.exists()) {					LOG.info("creating elements.dbx");					elementsDb.create();				} else					elementsDb.open();				config.setProperty("db-connection.elements", elementsDb);				readOnly = elementsDb.isReadOnly();			}			if ((domDb = (DOMFile) config.getProperty("db-connection.dom")) == null) {				if (config.hasProperty("db-connection.buffers")) {					indexBuffers = buffers;					dataBuffers = 512;				} else {					indexBuffers = buffers * 4;					dataBuffers = buffers;				}				LOG.debug("page buffer size = " + indexBuffers + "; " + dataBuffers);				domDb =					new DOMFile(						new File(dataDir + pathSep + "dom.dbx"),						indexBuffers,						dataBuffers);				if (!domDb.exists()) {					LOG.info("creating dom.dbx");					domDb.create();				} else					domDb.open();				config.setProperty("db-connection.dom", domDb);				if (!readOnly)					readOnly = domDb.isReadOnly();			}			if ((collectionsDb =				(CollectionStore) config.getProperty("db-connection.collections"))				== null) {				if ((indexBuffers =					config.getInteger("db-connection.collections.buffers"))					< 0) {					indexBuffers = buffers * 8;					dataBuffers = buffers * 8;				} else					dataBuffers = indexBuffers;				LOG.debug(					"collections index buffer size: "						+ indexBuffers						+ "; "						+ dataBuffers);				collectionsDb =					new CollectionStore(						new File(dataDir + pathSep + "collections.dbx"),						indexBuffers,						dataBuffers);				if (!collectionsDb.exists()) {					LOG.info("creating collections.dbx");					collectionsDb.create();				} else					collectionsDb.open();				config.setProperty("db-connection.collections", collectionsDb);				if (!readOnly)					readOnly = collectionsDb.isReadOnly();			}			if (readOnly)				LOG.info("database runs in read-only mode");						idxPathMap = (Map) config.getProperty("indexer.map");			textEngine = new NativeTextEngine(this, config, buffers);			xmlSerializer = new NativeSerializer(this, config);			elementIndex = new NativeElementIndex(this, config, elementsDb);			user = new User("admin", null, "dba");			getOrCreateCollection(ROOT_COLLECTION);		} catch (DBException e) {			LOG.debug("failed to initialize database: " + e.getMessage(), e);			throw new EXistException(e);		} catch (PermissionDeniedException e) {			LOG.debug("failed to initialize database: " + e.getMessage(), e);			throw new EXistException(e);		}	}