@@ -396,6 +396,12 @@ type Namespaces interface {
396396 // SetPersistenceWithContext sets the persistence configuration for all the topics on a namespace
397397 SetPersistenceWithContext (ctx context.Context , namespace string , persistence utils.PersistencePolicies ) error
398398
399+ // RemovePersistence removes the persistence configuration for a namespace
400+ RemovePersistence (namespace string ) error
401+
402+ // RemovePersistenceWithContext removes the persistence configuration for a namespace
403+ RemovePersistenceWithContext (ctx context.Context , namespace string ) error
404+
399405 // GetPersistence returns the persistence configuration for a namespace.
400406 // Returns nil if the persistence policy is not configured at the namespace level.
401407 GetPersistence (namespace string ) (* utils.PersistencePolicies , error )
@@ -1433,6 +1439,19 @@ func (n *namespaces) SetPersistenceWithContext(
14331439 return n .pulsar .Client .PostWithContext (ctx , endpoint , & persistence )
14341440}
14351441
1442+ func (n * namespaces ) RemovePersistence (namespace string ) error {
1443+ return n .RemovePersistenceWithContext (context .Background (), namespace )
1444+ }
1445+
1446+ func (n * namespaces ) RemovePersistenceWithContext (ctx context.Context , namespace string ) error {
1447+ nsName , err := utils .GetNamespaceName (namespace )
1448+ if err != nil {
1449+ return err
1450+ }
1451+ endpoint := n .pulsar .endpoint (n .basePath , nsName .String (), "persistence" )
1452+ return n .pulsar .Client .DeleteWithContext (ctx , endpoint )
1453+ }
1454+
14361455func (n * namespaces ) SetBookieAffinityGroup (namespace string , bookieAffinityGroup utils.BookieAffinityGroupData ) error {
14371456 return n .SetBookieAffinityGroupWithContext (context .Background (), namespace , bookieAffinityGroup )
14381457}
0 commit comments