use of org.apache.carbondata.core.locks.LocalFileLock in project carbondata by apache.
the class LocalFileLockTest method testingLocalFileLockingByAcquiring2Locks.
@Test
public void testingLocalFileLockingByAcquiring2Locks() {
CarbonTableIdentifier carbonTableIdentifier = new CarbonTableIdentifier("databaseName", "tableName", "tableId");
LocalFileLock localLock1 = new LocalFileLock(carbonTableIdentifier, LockUsage.METADATA_LOCK);
Assert.assertTrue(localLock1.lock());
LocalFileLock localLock2 = new LocalFileLock(carbonTableIdentifier, LockUsage.METADATA_LOCK);
Assert.assertTrue(!localLock2.lock());
Assert.assertTrue(localLock1.unlock());
Assert.assertTrue(localLock2.lock());
}
Aggregations