Hi Shashika,

In solr indexing, we store the resource by its tenant_id
(indexed_document_id = resourcePath + "tenant" + tenantId)

e.g: Assume you stored resource from the tenant1, indexed document id looks
like below,

"id": "/_system/governance/services/aaa/aaa/1.0.0*tenantId1*"

You can get all resource store under tenantId using wildcard search.

id:**tenantId1*
>

In Solr server, they have provided an api to delete by query.

deleteByQuery(String query)
>

We can write new method in SolrClient to support this and call it from your
component. Currently we only support delete index by resource id where we
need resource path.

Thanks
Danesh

On Mon, Feb 23, 2015 at 7:14 PM, Senaka Fernando <sen...@wso2.com> wrote:

> Hi Shashika,
>
> I believe this is the only way to do this. There are several things to
> note here.
>
> 1. In memory data - Ideally unloading the tenant should clean-up all of
> this and if it does not there is an issue.
> 2. DB data - all the tables have a tenant-id column. What you need is a
> query to delete all records matching that tenant id.
> 3. Solr Index etc and Registry Extensions deployed on the Filesystem -
> These should be in corresponding folder/files structures either having a
> tenant id or tenant domain. I don't recall this is as X, Y, and Z and I
> don't think anyone else would do too. You can scan the code (Registry
> Kernel, Registry Component and Governance Component) but it can be tedious.
> So, may be you can setup a tenant and grep for tenant-id/domain or grep for
> "-1234" and "carbon.super" in the filesystem.
> 4. Other related data - The kernel alone uses the filesystem (inside
> repository/deployment) which you might need to clean. There are temporary
> files created that many require cleaning and also logs, if you are
> interested in a full wipeout. The registry utilises some of these standard
> features from the kernel and some information (mostly transient) can be
> found in those.
>
> Appreciate some help from others in the G-Reg team to identify anything I
> missed.
>
> Thanks,
> Senaka.
>
> On Mon, Feb 23, 2015 at 6:02 AM, Shashika Karunatilaka <shashi...@wso2.com
> > wrote:
>
>> Hi,
>>
>> Im in the process of deleting a tenant and all its related resources,so
>> what i came up with is to delete all the resources related to that tenant
>> using a direct DB call is there any other options to delete these data.
>> and if i to continue on the above approach what are the areas i have to
>> concern
>>
>> --
>> Shashika Prabath Karunatilaka,
>> Software Engineer,
>> WSO2, Inc: http://wso2.com/
>> mobile : +94 77 7487792
>>
>
>
>
> --
>
>
> *[image: http://wso2.com] <http://wso2.com>Senaka Fernando*
> Solutions Architect; WSO2 Inc.; http://wso2.com
>
>
>
> *Member; Apache Software Foundation; http://apache.org
> <http://apache.org>E-mail: senaka AT wso2.com <http://wso2.com>**P: +1
> 408 754 7388 <%2B1%20408%20754%207388>; ext: 51736*;
>
>
> *M: +44 782 741 1966 <%2B44%20782%20741%201966>Linked-In:
> http://linkedin.com/in/senakafernando
> <http://linkedin.com/in/senakafernando>*Lean . Enterprise . Middleware
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Danesh Kuruppu
Software Engineer
WSO2 Inc,
Mobile: +94 (77) 1690552
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to