hive.directory().insertPrimaryIndexKey(key);
NodeResolver directory = new DbDirectory(partitionDimension, CachingDataSourceProvider.getInstance().getDataSource(hive.getUri()));
for (Integer id : Transform.map(DirectoryWrapper.semaphoreToId(), directory.getKeySemamphoresOfPrimaryIndexKey(key)))
hive.getNode(id).setStatus(Status.readOnly);
AssertUtils.assertThrows(new Toss() {
public void f() throws Exception {
hive.connection().getByPartitionKey(key, AccessType.ReadWrite);
}
}, HiveLockableException.class);
}