
org.zoodb.jdo.internal.server.StorageRootFile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parent Show documentation
Show all versions of parent Show documentation
ZooDB Java JDO Object Database.
The newest version!
/*
* Copyright 2009-2013 Tilmann Zaeschke. All rights reserved.
*
* This file is part of ZooDB.
*
* ZooDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZooDB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZooDB. If not, see .
*
* See the README and COPYING files for further information.
*/
package org.zoodb.jdo.internal.server;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.util.ArrayList;
import org.zoodb.api.ZooDebug;
import org.zoodb.jdo.api.impl.DBStatistics;
import org.zoodb.jdo.internal.server.index.FreeSpaceManager;
import org.zoodb.jdo.internal.util.DBLogger;
import org.zoodb.jdo.internal.util.PrimLongMapLI;
/**
* A common root for multiple file views. Each view accesses its own page,
* the root contains the common file resource.
*
* @author Tilmann Zaeschke
*
*/
public final class StorageRootFile implements StorageChannel {
private final ArrayList viewsIn = new ArrayList();
private final ArrayList viewsOut = new ArrayList();
private final FreeSpaceManager fsm;
private final RandomAccessFile raf;
private final FileLock fileLock;
private final FileChannel fc;
// use LONG to enforce long-arithmetic in calculations
private final long PAGE_SIZE;
private int statNRead;
private int statNWrite;
private final PrimLongMapLI
© 2015 - 2025 Weber Informatics LLC | Privacy Policy