You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/03/25 18:54:13 UTC
svn commit: r1581428 [7/8] - in /qpid/branches/java-broker-bdb-ha2: ./ qpid/
qpid/cpp/ qpid/cpp/bindings/qpid/dotnet/ qpid/cpp/docs/man/
qpid/cpp/include/qpid/messaging/ qpid/cpp/src/
qpid/cpp/src/qpid/client/amqp0_10/ qpid/cpp/src/qpid/linearstore/ qp...
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java Tue Mar 25 17:54:10 2014
@@ -29,7 +29,7 @@ import java.util.concurrent.ConcurrentHa
import org.apache.log4j.Logger;
import org.apache.qpid.server.message.EnqueueableMessage;
-import org.apache.qpid.server.plugin.DurableConfigurationStoreFactory;
+import org.apache.qpid.server.model.ConfiguredObject;
import org.apache.qpid.server.plugin.MessageStoreFactory;
public class SlowMessageStore implements MessageStore, DurableConfigurationStore
@@ -64,9 +64,9 @@ public class SlowMessageStore implements
}
@Override
- public void recoverConfigurationStore(ConfigurationRecoveryHandler recoveryHandler)
+ public void recoverConfigurationStore(ConfiguredObject<?> parent, ConfigurationRecoveryHandler recoveryHandler)
{
- _realDurableConfigurationStore.recoverConfigurationStore(recoveryHandler);
+ _realDurableConfigurationStore.recoverConfigurationStore(parent, recoveryHandler);
}
private void configureDelays(Map<String, Object> delays)
@@ -183,7 +183,6 @@ public class SlowMessageStore implements
_realDurableConfigurationStore.closeConfigurationStore();
}
-
@Override
public <M extends StorableMessageMetaData> StoredMessage<M> addMessage(M metaData)
{
@@ -191,39 +190,24 @@ public class SlowMessageStore implements
}
@Override
- public void create(UUID id, String type, Map<String, Object> attributes) throws StoreException
+ public void create(ConfiguredObjectRecord record) throws StoreException
{
doPreDelay("create");
- _realDurableConfigurationStore.create(id, type, attributes);
+ _realDurableConfigurationStore.create(record);
doPostDelay("create");
}
- @Override
- public void remove(UUID id, String type) throws StoreException
- {
- doPreDelay("remove");
- _realDurableConfigurationStore.remove(id, type);
- doPostDelay("remove");
- }
@Override
- public UUID[] removeConfiguredObjects(final UUID... objects) throws StoreException
+ public UUID[] remove(final ConfiguredObjectRecord... objects) throws StoreException
{
doPreDelay("remove");
- UUID[] removed = _realDurableConfigurationStore.removeConfiguredObjects(objects);
+ UUID[] removed = _realDurableConfigurationStore.remove(objects);
doPostDelay("remove");
return removed;
}
@Override
- public void update(UUID id, String type, Map<String, Object> attributes) throws StoreException
- {
- doPreDelay("update");
- _realDurableConfigurationStore.update(id, type, attributes);
- doPostDelay("update");
- }
-
- @Override
public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
{
doPreDelay("update");
@@ -310,9 +294,9 @@ public class SlowMessageStore implements
}
@Override
- public void recoverMessageStore(MessageStoreRecoveryHandler messageRecoveryHandler, TransactionLogRecoveryHandler transactionLogRecoveryHandler)
+ public void recoverMessageStore(ConfiguredObject<?> parent, MessageStoreRecoveryHandler messageRecoveryHandler, TransactionLogRecoveryHandler transactionLogRecoveryHandler)
{
- _realMessageStore.recoverMessageStore(messageRecoveryHandler, transactionLogRecoveryHandler);
+ _realMessageStore.recoverMessageStore(parent, messageRecoveryHandler, transactionLogRecoveryHandler);
}
@Override
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java Tue Mar 25 17:54:10 2014
@@ -63,8 +63,7 @@ public class BrokerACLTest extends QpidR
super.customizeConfiguration();
getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_USER + " CONFIGURE BROKER",
"ACL DENY-LOG " + DENIED_USER + " CONFIGURE BROKER",
"ACL DENY-LOG ALL ALL");
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java Tue Mar 25 17:54:10 2014
@@ -47,8 +47,7 @@ public class ExchangeRestACLTest extends
super.customizeConfiguration();
getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_USER + " CREATE QUEUE",
"ACL ALLOW-LOG " + ALLOWED_USER + " CREATE EXCHANGE",
"ACL DENY-LOG " + DENIED_USER + " CREATE EXCHANGE",
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java Tue Mar 25 17:54:10 2014
@@ -94,8 +94,7 @@ public class GroupRestACLTest extends Qp
public void testCreateGroup() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " CREATE GROUP",
"ACL DENY-LOG " + DENIED_GROUP + " CREATE GROUP");
@@ -121,8 +120,7 @@ public class GroupRestACLTest extends Qp
public void testDeleteGroup() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " DELETE GROUP",
"ACL DENY-LOG " + DENIED_GROUP + " DELETE GROUP");
@@ -148,8 +146,7 @@ public class GroupRestACLTest extends Qp
public void testUpdateGroupAddMember() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " UPDATE GROUP",
"ACL DENY-LOG " + DENIED_GROUP + " UPDATE GROUP");
@@ -169,8 +166,7 @@ public class GroupRestACLTest extends Qp
public void testUpdateGroupDeleteMember() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " UPDATE GROUP",
"ACL DENY-LOG " + DENIED_GROUP + " UPDATE GROUP");
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java Tue Mar 25 17:54:10 2014
@@ -38,8 +38,7 @@ public class LogViewerACLTest extends Qp
super.customizeConfiguration();
getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_USER + " ACCESS_LOGS BROKER",
"ACL DENY-LOG " + DENIED_USER + " ACCESS_LOGS BROKER",
"ACL DENY-LOG ALL ALL");
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java Tue Mar 25 17:54:10 2014
@@ -42,8 +42,7 @@ public class QueueRestACLTest extends Qp
super.customizeConfiguration();
getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_USER + " CREATE QUEUE",
"ACL DENY-LOG " + DENIED_USER + " CREATE QUEUE",
"ACL ALLOW-LOG " + ALLOWED_USER + " UPDATE QUEUE",
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java Tue Mar 25 17:54:10 2014
@@ -76,7 +76,7 @@ public class UserPreferencesRestACLTest
super.customizeConfiguration();
getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
- AbstractACLTestCase.writeACLFileUtil(this, null, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT", "ACL ALLOW-LOG " + ALLOWED_USER
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT", "ACL ALLOW-LOG " + ALLOWED_USER
+ " UPDATE USER", "ACL DENY-LOG " + DENIED_USER + " UPDATE USER", "ACL DENY-LOG ALL ALL");
TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
Modified: qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java Tue Mar 25 17:54:10 2014
@@ -96,8 +96,7 @@ public class UserRestACLTest extends Qpi
public void testAddUser() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " CREATE USER",
"ACL DENY-LOG " + DENIED_GROUP + " CREATE USER");
@@ -121,8 +120,7 @@ public class UserRestACLTest extends Qpi
public void testDeleteUser() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " DELETE USER",
"ACL DENY-LOG " + DENIED_GROUP + " DELETE USER");
@@ -142,8 +140,7 @@ public class UserRestACLTest extends Qpi
public void testUpdateUser() throws Exception
{
- AbstractACLTestCase.writeACLFileUtil(this, null,
- "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+ AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
"ACL ALLOW-LOG " + ALLOWED_GROUP + " UPDATE USER",
"ACL DENY-LOG " + DENIED_GROUP + " UPDATE USER");
Propchange: qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/packaging/windows:r1576683-1581290
Modified: qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/INSTALL_NOTES.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/INSTALL_NOTES.html?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/INSTALL_NOTES.html (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/INSTALL_NOTES.html Tue Mar 25 17:54:10 2014
@@ -1,11 +1,11 @@
<html>
<head>
-<title>Apache Qpid C++ 0.27 Installation Notes</title>
+<title>Apache Qpid C++ 0.29 Installation Notes</title>
</head>
<body>
-<H1>Apache Qpid C++ 0.27 Installation Notes</H1>
+<H1>Apache Qpid C++ 0.29 Installation Notes</H1>
-<p>Thank you for installing Apache Qpid version 0.27 for Windows.
+<p>Thank you for installing Apache Qpid version 0.29 for Windows.
If the requisite features were installed, you can now run a broker,
use the example programs, and design your own messaging programs while
reading the Qpid C++ API reference documentation.</p>
@@ -83,7 +83,7 @@ default; therefore, to gain support for
must be loaded into the broker. This can be done using the
<code>--load-module</code> option to load the needed plugins. For example:
<pre>
-cd "C:\Program Files\Apache\qpidc-0.27"
+cd "C:\Program Files\Apache\qpidc-0.29"
qpidd.exe --load-module plugins\broker\store.dll --load-module plugins\broker\msclfs_store.dll
</pre>
The <code>--load-module</code> option can also take a full path. The option
Modified: qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/installer.proj
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/installer.proj?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/installer.proj (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/installer.proj Tue Mar 25 17:54:10 2014
@@ -32,7 +32,7 @@
<source_root>$(MSBuildProjectDirectory)\..\..</source_root>
<staging_dir>$(MSBuildProjectDirectory)\stage</staging_dir>
<bits Condition="'$(bits)' == ''">32</bits>
- <qpid_version>0.27</qpid_version>
+ <qpid_version>0.29</qpid_version>
<OutputName>qpidc</OutputName>
<OutputType>Package</OutputType>
<WixToolPath>C:\Program Files (x86)\Windows Installer XML v3.5\bin</WixToolPath>
Propchange: qpid/branches/java-broker-bdb-ha2/qpid/packaging/windows/installer.proj
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/packaging/windows/installer.proj:r1576683-1581290
Propchange: qpid/branches/java-broker-bdb-ha2/qpid/python/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/python:r1576683-1581290
Modified: qpid/branches/java-broker-bdb-ha2/qpid/python/setup.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/python/setup.py?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/python/setup.py (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/python/setup.py Tue Mar 25 17:54:10 2014
@@ -298,7 +298,7 @@ class install_lib(_install_lib):
return outfiles + extra
setup(name="qpid-python",
- version="0.27",
+ version="0.29",
author="Apache Qpid",
author_email="dev@qpid.apache.org",
packages=["mllib", "qpid", "qpid.messaging", "qpid.tests",
Modified: qpid/branches/java-broker-bdb-ha2/qpid/tests/setup.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/tests/setup.py?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/tests/setup.py (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/tests/setup.py Tue Mar 25 17:54:10 2014
@@ -20,7 +20,7 @@
from distutils.core import setup
setup(name="qpid-tests",
- version="0.27",
+ version="0.29",
author="Apache Qpid",
author_email="dev@qpid.apache.org",
packages=["qpid_tests", "qpid_tests.broker_0_10", "qpid_tests.broker_0_9",
Modified: qpid/branches/java-broker-bdb-ha2/qpid/tools/setup.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/tools/setup.py?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/tools/setup.py (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/tools/setup.py Tue Mar 25 17:54:10 2014
@@ -19,8 +19,22 @@
#
from distutils.core import setup
+pypi_long_description = """
+
+===========
+qpidtoollibs
+===========
+
+qpidtoollibs provides a useful BrokerAgent object for managing a Qpid broker
+using Qpid Management Framework (QMF).
+
+This library depends on the qpid.messaging python client to send AMQP messaging
+containing QMF commands to the Qpid broker.
+
+"""
+
setup(name="qpid-tools",
- version="0.27",
+ version="0.29",
author="Apache Qpid",
author_email="dev@qpid.apache.org",
package_dir={'' : 'src/py'},
@@ -35,4 +49,8 @@ setup(name="qpid-tools",
"src/py/qmf-tool"],
url="http://qpid.apache.org/",
license="Apache Software License",
- description="Diagnostic and management tools for Apache Qpid brokers.")
+ description="Diagnostic and management tools for Apache Qpid brokers.",
+ long_description=pypi_long_description,
+ install_requires=[
+ "qpid-python >= 0.26",
+ ])
Modified: qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/efp.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/efp.py?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/efp.py (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/efp.py Tue Mar 25 17:54:10 2014
@@ -17,38 +17,137 @@
# under the License.
#
+"""
+Module: qls.efp
+
+Contains empty file pool (EFP) classes.
+"""
+
import os
import os.path
import qls.err
+import shutil
+import uuid
class EfpManager(object):
"""
Top level class to analyze the Qpid Linear Store (QLS) directory for the partitions that make up the
Empty File Pool (EFP).
"""
- def __init__(self, directory, args):
+ def __init__(self, directory, disk_space_required_kb):
if not os.path.exists(directory):
raise qls.err.InvalidQlsDirectoryNameError(directory)
self.directory = directory
- self.args = args
- self.partitions = []
+ self.disk_space_required_kb = disk_space_required_kb
+ self.efp_partitions = []
+ self.efp_pools = {}
+ self.total_num_files = 0
+ self.total_cum_file_size_kb = 0
+ self.current_efp_partition = None
+ def add_file_pool(self, file_size_kb, num_files):
+ """ Add an EFP in the specified partition of the specified size containing the specified number of files """
+ dir_name = EmptyFilePool.get_directory_name(file_size_kb)
+ print 'Adding pool \'%s\' to partition %s' % (dir_name, self.current_efp_partition.partition_number)
+ self.total_cum_file_size_kb += self.current_efp_partition.create_new_efp(file_size_kb, num_files)
+ self.total_num_files += num_files
+ def freshen_file_pool(self, file_size_kb, num_files):
+ """ Freshen an EFP in the specified partition and of the specified size to the specified number of files """
+ if self.current_efp_partition is None:
+ partition_list = self.efp_partitions
+ partition_str = 'all partitions'
+ else:
+ partition_list = [self.current_efp_partition]
+ partition_str = 'partition %d' % self.current_efp_partition.partition_number
+ if file_size_kb is None:
+ pool_str = 'all pools'
+ else:
+ pool_str = 'pool \'%s\'' % EmptyFilePool.get_directory_name(int(file_size_kb))
+ print 'Freshening %s in %s to %d files' % (pool_str, partition_str, num_files)
+ for self.current_efp_partition in partition_list: # Partition objects
+ if file_size_kb is None:
+ file_size_list = self.current_efp_partition.efp_pools.keys()
+ else:
+ file_size_list = ['%sk' % file_size_kb]
+ for file_size in file_size_list:
+ efp = self.current_efp_partition.efp_pools[file_size]
+ num_files_needed = num_files - efp.get_tot_file_count()
+ if num_files_needed > 0:
+ self.current_efp_partition.create_new_efp_files(qls.utils.efp_directory_size(file_size),
+ num_files_needed)
+ else:
+ print ' WARNING: Pool %s in partition %s already contains %d files: no action taken' % \
+ (self.current_efp_partition.efp_pools[file_size].size_str,
+ self.current_efp_partition.partition_number, efp.get_num_files())
+ def remove_file_pool(self, file_size_kb):
+ """ Remove an existing EFP from the specified partition and of the specified size """
+ dir_name = EmptyFilePool.get_directory_name(file_size_kb)
+ print 'Removing pool \'%s\' from partition %s' % (dir_name, self.current_efp_partition.partition_number)
+ self.efp_partitions.remove(self.current_efp_partition)
+ shutil.rmtree(os.path.join(self.current_efp_partition.efp_directory, dir_name))
def report(self):
- print 'Found', len(self.partitions), 'partition(s).'
- if (len(self.partitions)) > 0:
+ print 'Empty File Pool (EFP) report:'
+ print '============================='
+ print 'Found', len(self.efp_partitions), 'partition(s).'
+ if (len(self.efp_partitions)) > 0:
EfpPartition.print_report_table_header()
- for ptn in self.partitions:
+ for ptn in self.efp_partitions:
ptn.print_report_table_line()
print
- for ptn in self.partitions:
+ for ptn in self.efp_partitions:
ptn.report()
- def run(self, _):
+ def run(self, arg_tup):
+ self._analyze_efp()
+ if arg_tup is not None:
+ _, arg_file_size, arg_num_files, arg_add, arg_remove, arg_freshen, arg_list = arg_tup
+ self._check_args(arg_tup)
+ if arg_add:
+ self.add_file_pool(int(arg_file_size), int(arg_num_files))
+ if arg_remove:
+ self.remove_file_pool(int(arg_file_size))
+ if arg_freshen:
+ self.freshen_file_pool(arg_file_size, int(arg_num_files))
+ if arg_list:
+ self.report()
+ def _analyze_efp(self):
for dir_entry in os.listdir(self.directory):
try:
- efpp = EfpPartition(os.path.join(self.directory, dir_entry))
- efpp.scan()
- self.partitions.append(efpp)
+ efp_partition = EfpPartition(os.path.join(self.directory, dir_entry), self.disk_space_required_kb)
+ efp_partition.scan()
+ self.efp_partitions.append(efp_partition)
+ for efpl in efp_partition.efp_pools.iterkeys():
+ if efpl not in self.efp_pools:
+ self.efp_pools[efpl] = []
+ self.efp_pools[efpl].append(efp_partition.efp_pools[efpl])
+ self.total_num_files += efp_partition.tot_file_count
+ self.total_cum_file_size_kb += efp_partition.tot_file_size_kb
except qls.err.InvalidPartitionDirectoryNameError:
pass
+ def _check_args(self, arg_tup):
+ """ Value check of args. The names of partitions and pools are validated against the discovered instances """
+ arg_partition, arg_file_size, _, arg_add, arg_remove, arg_freshen, _ = arg_tup
+ if arg_partition is not None:
+ try:
+ if arg_partition[0] == 'p': # string partition name, eg 'p001'
+ partition_num = int(arg_partition[1:])
+ else: # numeric partition, eg '1'
+ partition_num = int(arg_partition)
+ found = False
+ for partition in self.efp_partitions:
+ if partition.partition_number == partition_num:
+ self.current_efp_partition = partition
+ found = True
+ break
+ if not found:
+ raise qls.err.PartitionDoesNotExistError(arg_partition)
+ except ValueError:
+ raise qls.err.InvalidPartitionDirectoryNameError(arg_partition)
+ if self.current_efp_partition is not None:
+ pool_list = self.current_efp_partition.efp_pools.keys()
+ efp_directory_name = EmptyFilePool.get_directory_name(int(arg_file_size))
+ if arg_add and efp_directory_name in pool_list:
+ raise qls.err.PoolDirectoryAlreadyExistsError(efp_directory_name)
+ if (arg_remove or arg_freshen) and efp_directory_name not in pool_list:
+ raise qls.err.PoolDirectoryDoesNotExistError(efp_directory_name)
class EfpPartition(object):
"""
@@ -56,55 +155,59 @@ class EfpPartition(object):
"""
PTN_DIR_PREFIX = 'p'
EFP_DIR_NAME = 'efp'
- def __init__(self, directory):
- self.base_dir = os.path.basename(directory)
- if self.base_dir[0] is not EfpPartition.PTN_DIR_PREFIX:
- raise qls.err.InvalidPartitionDirectoryNameError(directory)
- try:
- self.partition_number = int(self.base_dir[1:])
- except ValueError:
- raise qls.err.InvalidPartitionDirectoryNameError(directory)
+ def __init__(self, directory, disk_space_required_kb):
self.directory = directory
- self.pools = []
- self.efp_count = 0
+ self.partition_number = None
+ self.efp_pools = {}
self.tot_file_count = 0
self.tot_file_size_kb = 0
- def get_directory(self):
- return self.directory
- def get_efp_count(self):
- return self.efp_count
- def get_name(self):
- return self.base_dir
- def get_number(self):
- return self.partition_number
- def get_number_pools(self):
- return len(self.pools)
- def get_tot_file_count(self):
- return self.tot_file_count
- def get_tot_file_size_kb(self):
- return self.tot_file_size_kb
+ self._validate_partition_directory(disk_space_required_kb)
+ def create_new_efp_files(self, file_size_kb, num_files):
+ """ Create new EFP files in this partition """
+ dir_name = EmptyFilePool.get_directory_name(file_size_kb)
+ if dir_name in self.efp_pools.keys():
+ efp = self.efp_pools[dir_name]
+ else:
+ efp = EmptyFilePool(os.path.join(self.directory, EfpPartition.EFP_DIR_NAME), dir_name)
+ this_tot_file_size_kb = efp.create_new_efp_files(num_files)
+ self.tot_file_size_kb += this_tot_file_size_kb
+ self.tot_file_count += num_files
+ return this_tot_file_size_kb
@staticmethod
def print_report_table_header():
print 'p_no no_efp tot_files tot_size_kb directory'
print '---- ------ --------- ----------- ---------'
def print_report_table_line(self):
- print '%4d %6d %9d %11d %s' % (self.get_number(), self.get_efp_count(), self.get_tot_file_count(),
- self.get_tot_file_size_kb(), self.get_directory())
+ print '%4d %6d %9d %11d %s' % (self.partition_number, len(self.efp_pools), self.tot_file_count,
+ self.tot_file_size_kb, self.directory)
def report(self):
- print 'Partition %s:' % self.base_dir
+ print 'Partition %s:' % os.path.basename(self.directory)
EmptyFilePool.print_report_table_header()
- for pool in self.pools:
- pool.print_report_table_line()
+ for dir_name in self.efp_pools.keys():
+ self.efp_pools[dir_name].print_report_table_line()
print
def scan(self):
if os.path.exists(self.directory):
efp_dir = os.path.join(self.directory, EfpPartition.EFP_DIR_NAME)
for dir_entry in os.listdir(efp_dir):
- efp = EmptyFilePool(os.path.join(efp_dir, dir_entry))
- self.efp_count += 1
+ efp = EmptyFilePool(os.path.join(efp_dir, dir_entry), self.partition_number)
+ efp.scan()
self.tot_file_count += efp.get_tot_file_count()
self.tot_file_size_kb += efp.get_tot_file_size_kb()
- self.pools.append(efp)
+ self.efp_pools[dir_entry] = efp
+ def _validate_partition_directory(self, disk_space_required_kb):
+ if os.path.basename(self.directory)[0] is not EfpPartition.PTN_DIR_PREFIX:
+ raise qls.err.InvalidPartitionDirectoryNameError(self.directory)
+ try:
+ self.partition_number = int(os.path.basename(self.directory)[1:])
+ except ValueError:
+ raise qls.err.InvalidPartitionDirectoryNameError(self.directory)
+ if not qls.utils.has_write_permission(self.directory):
+ raise qls.err.WritePermissionError(self.directory)
+ if disk_space_required_kb is not None:
+ space_avail = qls.utils.get_avail_disk_space(self.directory)
+ if space_avail < (disk_space_required_kb * 1024):
+ raise qls.err.InsufficientSpaceOnDiskError(self.directory, space_avail, disk_space_required_kb * 1024)
class EmptyFilePool(object):
"""
@@ -112,33 +215,89 @@ class EmptyFilePool(object):
journal files (but it may also be empty).
"""
EFP_DIR_SUFFIX = 'k'
- def __init__(self, directory):
- self.base_dir = os.path.basename(directory)
- if self.base_dir[-1] is not EmptyFilePool.EFP_DIR_SUFFIX:
- raise qls.err.InvalidEfpDirectoryNameError(directory)
- try:
- self.data_size_kb = int(os.path.basename(self.base_dir)[:-1])
- except ValueError:
- raise qls.err.InvalidEfpDirectoryNameError(directory)
+ EFP_JRNL_EXTENTION = '.jrnl'
+ def __init__(self, directory, partition_number):
+ self.base_dir_name = os.path.basename(directory)
self.directory = directory
- self.files = os.listdir(directory)
+ self.partition_number = partition_number
+ self.data_size_kb = None
+ self.files = []
+ self.tot_file_size_kb = 0
+ self._validate_efp_directory()
+ def create_new_efp_files(self, num_files):
+ """ Create one or more new empty journal files of the prescribed size for this EFP """
+ this_total_file_size = 0
+ for _ in range(num_files):
+ this_total_file_size += self._create_new_efp_file()
+ return this_total_file_size
def get_directory(self):
return self.directory
- def get_file_data_size_kb(self):
- return self.data_size_kb
- def get_name(self):
- return self.base_dir
+ @staticmethod
+ def get_directory_name(file_size_kb):
+ """ Static function to create an EFP directory name from the size of the files it contains """
+ return '%dk' % file_size_kb
def get_tot_file_count(self):
return len(self.files)
def get_tot_file_size_kb(self):
return self.data_size_kb * len(self.files)
@staticmethod
def print_report_table_header():
- print 'file_size_kb file_count tot_file_size_kb efp_directory'
+ print 'data_size_kb file_count tot_file_size_kb efp_directory'
print '------------ ---------- ---------------- -------------'
def print_report_table_line(self):
- print '%12d %10d %16d %s' % (self.get_file_data_size_kb(), self.get_tot_file_count(),
+ print '%12d %10d %16d %s' % (self.data_size_kb, self.get_tot_file_count(),
self.get_tot_file_size_kb(), self.get_directory())
+ def scan(self):
+ for efp_file in os.listdir(self.directory):
+ if self._validate_efp_file(os.path.join(self.directory, efp_file)):
+ self.files.append(efp_file)
+ def _add_efp_file(self, efp_file_name):
+ """ Add a single journal file of the appropriate size to this EFP. No file size check is made here. """
+ self.files.append(efp_file_name)
+ self.tot_file_size_kb += os.path.getsize(efp_file_name)
+ def _create_new_efp_file(self):
+ """ Create a single new empty journal file of the prescribed size for this EFP """
+ file_name = str(uuid.uuid4()) + EmptyFilePool.EFP_JRNL_EXTENTION
+ file_header = qls.jrnl.FileHeader(0, qls.jrnl.FileHeader.MAGIC, qls.utils.DEFAULT_RECORD_VERSION, 0, 0, 0)
+ file_header.init(None, None, qls.utils.DEFAULT_HEADER_SIZE_SBLKS, self.partition_number, self.data_size_kb,
+ 0, 0, 0, 0, 0)
+ efh = file_header.encode()
+ efh_bytes = len(efh)
+ file_handle = open(os.path.join(self.directory, file_name), 'wb')
+ file_handle.write(efh)
+ file_handle.write('\xff' * (qls.utils.DEFAULT_SBLK_SIZE - efh_bytes))
+ file_handle.write('\x00' * (int(self.data_size_kb) * 1024))
+ file_handle.close()
+ fqfn = os.path.join(self.directory, file_name)
+ self._add_efp_file(fqfn)
+ return os.path.getsize(fqfn)
+ def _validate_efp_directory(self):
+ if self.base_dir_name[-1] is not EmptyFilePool.EFP_DIR_SUFFIX:
+ raise qls.err.InvalidEfpDirectoryNameError(self.directory)
+ try:
+ self.data_size_kb = int(os.path.basename(self.base_dir_name)[:-1])
+ except ValueError:
+ raise qls.err.InvalidEfpDirectoryNameError(self.directory)
+ def _validate_efp_file(self, efp_file):
+ file_size = os.path.getsize(efp_file)
+ expected_file_size = (self.data_size_kb * 1024) + qls.utils.DEFAULT_SBLK_SIZE
+ if file_size != expected_file_size:
+ print 'WARNING: File %s not of correct size (size=%d, expected=%d): Ignoring' % (efp_file, file_size,
+ expected_file_size)
+ return False
+ file_handle = open(efp_file)
+ args = qls.utils.load_args(file_handle, qls.jrnl.RecordHeader)
+ file_hdr = qls.jrnl.FileHeader(*args)
+ file_hdr.init(file_handle, *qls.utils.load_args(file_handle, qls.jrnl.FileHeader))
+ if not file_hdr.is_header_valid(file_hdr):
+ file_handle.close()
+ return False
+ file_hdr.load(file_handle)
+ file_handle.close()
+ if not file_hdr.is_valid():
+ return False
+ return True
+
# =============================================================================
Modified: qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/err.py
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/err.py?rev=1581428&r1=1581427&r2=1581428&view=diff
==============================================================================
--- qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/err.py (original)
+++ qpid/branches/java-broker-bdb-ha2/qpid/tools/src/py/qls/err.py Tue Mar 25 17:54:10 2014
@@ -17,12 +17,20 @@
# under the License.
#
+"""
+Module: qls.err
+
+Contains error classes.
+"""
+
# --- Parent classes
class QlsError(Exception):
"""Base error class for QLS errors and exceptions"""
def __init__(self):
Exception.__init__(self)
+ def __str__(self):
+ return ''
class QlsRecordError(QlsError):
"""Base error class for individual records"""
@@ -92,10 +100,22 @@ class FirstRecordOffsetMismatchError(Qls
def __str__(self):
return 'First record offset mismatch: ' + QlsRecordError.__str__(self) + ' expected_offset=0x%x' % \
self.file_header.first_record_offset
-
+
+class InsufficientSpaceOnDiskError(QlsError):
+ """Insufficient space on disk"""
+ def __init__(self, directory, space_avail, space_requried):
+ QlsError.__init__(self)
+ self.directory = directory
+ self.space_avail = space_avail
+ self.space_required = space_requried
+ def __str__(self):
+ return 'Insufficient space on disk: directory=%s; avail_space=%d required_space=%d' % \
+ (self.directory, self.space_avail, self.space_required)
+
class InvalidClassError(QlsError):
"""Invalid class name or type"""
def __init__(self, class_name):
+ QlsError.__init__(self)
self.class_name = class_name
def __str__(self):
return 'Invalid class name "%s"' % self.class_name
@@ -108,6 +128,14 @@ class InvalidEfpDirectoryNameError(QlsEr
def __str__(self):
return 'Invalid EFP directory name "%s"' % self.directory_name
+#class InvalidFileSizeString(QlsError):
+# """Invalid file size string"""
+# def __init__(self, file_size_string):
+# QlsError.__init__(self)
+# self.file_size_string = file_size_string
+# def __str__(self):
+# return 'Invalid file size string "%s"' % self.file_size_string
+
class InvalidPartitionDirectoryNameError(QlsError):
"""Invalid EFP partition name - should be pNNN, where NNN is a 3-digit partition number"""
def __init__(self, directory_name):
@@ -158,6 +186,30 @@ class NonTransactionalRecordError(QlsRec
return 'Transactional operation on non-transactional record: ' + QlsRecordError.__str__() + \
' operation=%s' % self.operation
+class PartitionDoesNotExistError(QlsError):
+ """Partition name does not exist on disk"""
+ def __init__(self, partition_directory):
+ QlsError.__init__(self)
+ self.partition_directory = partition_directory
+ def __str__(self):
+ return 'Partition %s does not exist' % self.partition_directory
+
+class PoolDirectoryAlreadyExistsError(QlsError):
+ """Pool directory already exists"""
+ def __init__(self, pool_directory):
+ QlsError.__init__(self)
+ self.pool_directory = pool_directory
+ def __str__(self):
+ return 'Pool directory %s already exists' % self.pool_directory
+
+class PoolDirectoryDoesNotExistError(QlsError):
+ """Pool directory does not exist"""
+ def __init__(self, pool_directory):
+ QlsError.__init__(self)
+ self.pool_directory = pool_directory
+ def __str__(self):
+ return 'Pool directory %s does not exist' % self.pool_directory
+
class RecordIdNotFoundError(QlsRecordError):
"""Record Id not found in enqueue map"""
def __init__(self, file_header, record):
@@ -184,6 +236,14 @@ class UnexpectedEndOfFileError(QlsError)
return 'Tried to read %d at offset %d in file "%s"; only read %d' % \
(self.size_read, self.file_offset, self.file_name, self.size_expected)
+class WritePermissionError(QlsError):
+ """No write permission"""
+ def __init__(self, directory):
+ QlsError.__init__(self)
+ self.directory = directory
+ def __str__(self):
+ return 'No write permission in directory %s' % self.directory
+
class XidSizeError(QlsError):
"""Error class for Xid size mismatch"""
def __init__(self, expected_size, actual_size, xid_str):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org