SlideShare a Scribd company logo
© 2014 aegif 
第24回 Alfresco勉強会 
コンテンツのライフサイクル 
2014年10月15日 
Jun Terashita
Alfresco上にコンテンツ(ノード)が作成されてから完全に消えてなくなるまで、裏側 
で何が起こっているかをご説明します。 
基本的には以下のBlogの翻訳になりますが、一部変わっている部分もあります。 
http://www.ixxus.com/blog/2011/09/alfresco-node-lifecycle 
© 2014 aegif 
発表の内容 
2 
今回使用するバージョン 
Alfresco Community 4.2.f
© 2014 aegif 
(準備)Alfrescoのリポジトリを構成する要素 
ファイルシステム(FS) 
ファイル実体。デフォルトでは以下のディレクトリに保存される。 
・<install_dir>/alf_data/conetntstore 
データベース(DB) 
コンテンツの属性情報やアソシエーション等、詳細情報が記録される。 
今回の内容で関係があるのは主に以下のテーブル。 
・alf_node 
・alf_node_properties 
・alf_content_data 
・alf_content_url 
Luceneインデックス(IDX) 
検索用のインデックス。なくなっても上記の2つからリビルドすることが可能。 
デフォルトでは以下のディレクトリに保存される(Solrを選択した場合)。 
・<install_dir>/alf_data/solr/workspace/SpacesStore/index/ 
・<install_dir>/alf_data/solr/archive/SpacesStore/index 
3
5. DBのクリーニング 
© 2014 aegif 
ライフサイクルの全体像 
4 
1. コンテンツ作成 
1 
2. コンテンツ削除 
3. ごみ箱から削除 
4. FSのクリーニング 
2 3 4 5 
14日(default) 
30日(default) 
FS contentstore contentstote contentstore contentstore.deleted contentstore.deleted 
DB 
alf_node 
alf_node.properties 
alf_content_data 
alf_content_url 
alf_node 
alf_node.properties 
alf_content_data 
alf_content_url 
alf_node 
alf_node.properties 
alf_content_url 
alf_node 
alf_node_properties ー 
(※) 
IDX workspace/ 
SpacesStore 
archive/ 
SpacesStore ーーー 
(※)関連レコードが存在するテーブルは他にもありますが主なテーブルのみ記載しています。
© 2014 aegif 
1. コンテンツ作成 
ブラウザでAlfresco Shareを開き、適当なフォルダにコンテンツを作成する。 
ノードブラウザで確認すると以下のようにファイル実体のパスやUUID、DBIDが確認できる。 
5 
DBID 
UUID ファイル実体のパス 
ストア
FS 
<install_dir>/alf_data/conetntstore 以下に日付で区切られたフォルダが作成され、そこにリネームし 
て保存される(リネーム後のファイル名とノードのUUIDは別物である点に注意)。 
© 2014 aegif 
1. コンテンツ作成 
6
DB 
alf_nodeテーブルから、alf_node_properties → alf_contente_data → alf_content_urlとたどり、 
ファイル実体のパスまで確認できる。 
alf_node 
© 2014 aegif 
1. コンテンツ作成 
7 
alf_node_properties 
qname_idがcm:contentのレコード
© 2014 aegif 
1. コンテンツ作成 
8 
alf_content_data 
alf_content_url 
ファイル実体のパス
IDX 
Lukeでインデックスの内容を確認すると、workspace/SpacesStore/indexの中にDBIDが一致するイ 
ンデックスが見つかる。 
© 2014 aegif 
1. コンテンツ作成 
9
© 2014 aegif 
2. コンテンツ削除 
Alfresco ShareのUIから1で作成したコンテンツを削除する。 
1と同様にノードブラウザから確認できる(ただし、ストアがarchiveになっている)。 
10 
DBID 
ファイル実体のパス 
UUID 
ストア
© 2014 aegif 
2. コンテンツ削除 
11 
FS 
変化なし。同じディレクトリに存在する。
© 2014 aegif 
2. コンテンツ削除 
DB 
alf_nodeテーブルのレコードが以下の2つになる。 
・store_idが「archive/SpacesStore」で、type_qname_idが「cm:content」 
・store_idが「workspace/SpacesStore」で、type_qname_idが「sys:deleted」 
alf_node 
alf_node_properties、alf_content_dataの関連レコードはidが変わる。 
ただし、alf_content_urlの関連レコードはidもそのまま。 
(スクリーンショットは割愛します) 
12
© 2014 aegif 
2. コンテンツ削除 
IDX 
archive/SpacesStore/indexの中にDBIDが一致するインデックスが見つかる(workspace/ 
SpacesStore/index の中には見つからない)。 
13
© 2014 aegif 
3. ごみ箱から削除 
ユーザプロファイルページからごみ箱を開き、コンテンツを削除する。 
※この時点でノードブラウザからは確認できなくなる。 
14 
FS 
変化なし。同じディレクトリに存在する。
© 2014 aegif 
3. ごみ箱から削除 
DB 
alf_nodeテーブルのstore_idが「archive/SpacesStore」だったレコードのtype_qname_idが 
「sys:deleted」に変わる。 
alf_node_propertiesにはoriginal idを保持するレコードがそれぞれ1つずつ。 
alf_content_dataの関連レコードは削除される。 
alf_content_urlの関連レコードはorphan_timeにごみ箱を空にした時刻が記録される。 
15 
alf_node 
alf_content_url
© 2014 aegif 
3. ごみ箱から削除 
IDX 
このタイミングでインデックスから完全に削除される。 
16
contentStoreCleanerが定期的に実行され、alf_content_urlテーブルのorphan_timeか 
ら一定期間経過しているファイル実体を、contentstoreからcontentstore.deletedに移 
動する。 
contentStoreCleanerのbean定義は、content-services-context.xmlを参照。 
これを発火するのがcontentStoreCleanerTriggerとcontentStoreCleanerJobDetailで、scheduled-jobs- 
© 2014 aegif 
4. FSのクリーニング 
context.xmlに定義されている。 
また、実行タイミングとorphan_timeからの保持期間はrepository.propertiesで設定されている。 
… 
# 
# Decide if content should be removed from the system immediately after being orphaned. 
# Do not change this unless you have examined the impact it has on your backup procedures. 
system.content.eagerOrphanCleanup=false 
# The number of days to keep orphaned content in the content stores. 
# This has no effect on the 'deleted' content stores, which are not automatically emptied. 
system.content.orphanProtectDays=14 
# The action to take when a store or stores fails to delete orphaned content 
# IGNORE: Just log a warning. The binary remains and the record is expunged 
# KEEP_URL: Log a warning and create a URL entry with orphan time 0. It won't be processed or removed. 
system.content.deletionFailureAction=IGNORE 
# The CRON expression to trigger the deletion of resources associated with orphaned content. 
system.content.orphanCleanup.cronExpression=0 0 4 * * ? 
… 
17 
repository.properties 
(補足)
FS 
ファイル実体がcontentstoreからcontentstore.deletedに移される。以降、contentstore.deletedの 
中身は自由に削除してよい。 
© 2014 aegif 
4. FSのクリーニング 
DB 
alf_nodeおよびalf_node_propertiesは変化なし。 
alf_content_urlから関連レコードが削除される。 
IDX 
「3. ごみ箱から削除」の時点でインデックスから削除されているため変化なし。 
18
DeletedNodeCleanupWorkerが定期的に実行され、alf_nodeその他のテーブルのレコー 
ドを削除する。 
ここでは、alf_nodeでsys:deletedになっているレコードに対応するalf_transactionテー 
ブルのcommit_time_msが一定期間経過しているものを抽出している。 
(補足) 
scheduled-jobs-context.xmlにnodeServiceCleanupJobDetailとnodeServiceCleanupTriggerのbean 
定義があり、cronExpressionはbean定義に直接書かれている。 
また、ごみ箱を空にしてからの保持期間は、repository.propertiesに設定されている。 
© 2014 aegif 
5. DBのクリーニング 
… 
# Index tracking information of a certain age is cleaned out by a scheduled job. 
# Any clustered system that has been offline for longer than this period will need to be seeded 
# with a more recent backup of the Lucene indexes or the indexes will have to be fully rebuilt. 
# Use -1 to disable purging. This can be switched on at any stage. 
index.tracking.minRecordPurgeAgeDays=30 
# Unused transactions will be purged in chunks determined by commit time boundaries. 'index.tracking.purgeSize' specifies the size 
# of the chunk (in ms). Default is a couple of hours. 
index.tracking.purgeSize=7200000 
… 
19 
repository.properties
FS 
「4. FSのクリーニング」の時点でファイル実体がcontentstoreからcontentstore.deletedに移されて 
いるため変化なし。 
DB 
alf_node、alf_node_properties、alf_transaction等から関連レコードが削除される。 
© 2014 aegif 
5. DBのクリーニング 
IDX 
「3. ごみ箱から削除」の時点でインデックスから削除されているため変化なし。 
20
5. DBのクリーニング 
© 2014 aegif 
(再掲)ライフサイクルの全体像 
21 
1. コンテンツ作成 
1 
2. コンテンツ削除 
3. ごみ箱から削除 
4. FSのクリーニング 
2 3 4 5 
14日(default) 
30日(default) 
FS contentstore contentstote contentstore contentstore.deleted contentstore.deleted 
DB 
alf_node 
alf_node.properties 
alf_content_data 
alf_content_url 
alf_node 
alf_node.properties 
alf_content_data 
alf_content_url 
alf_node 
alf_node.properties 
alf_content_url 
alf_node 
alf_node_properties ー 
(※) 
IDX workspace/ 
SpacesStore 
archive/ 
SpacesStore ーーー 
(※)関連レコードが存在するテーブルは他にもありますが主なテーブルのみ記載しています。
「4. FSのクリーニング」までファイルをcontentstoreに保持する理由 
・ファイルを一定期間contentstoreに保持することによって、DBとインデックスをバックアップからリ 
ストアする際に、ファイルシステムのリストアをする必要がなくなるため。 
・コンテンツ数が増えてくるとファイルシステムのリストアには時間がかかるため、時間の節約になる。 
・当然、DBとインデックスのバックアップは(デフォルトでは)14日以内のものである必要がある。 
「5. DBのクリーニング」までalf_node等のレコードを保持する理由 
・インデックスの差分リビルドの際に、インデックスのバックアップ作成時点から削除されたコンテン 
ツのインデックスを削除するため。 
・インデックスの差分リビルドにはalf_transactionテーブルに記録されたトランザクションを参照して 
おり、alf_transactionとalf_nodeが繋がっているため、レコードが消えているとインデックスの更新が 
できなくなる。 
・当然、インデックスのバックアップは(デフォルトでは)30日以内のものである必要がある。 
© 2014 aegif 
すぐに削除しない理由 
22
© 2014 aegif 
おわり

More Related Content

What's hot

C13 SQL Server2012知られざるTips集 by 平山理
C13 SQL Server2012知られざるTips集 by 平山理C13 SQL Server2012知られざるTips集 by 平山理
C13 SQL Server2012知られざるTips集 by 平山理
Insight Technology, Inc.
 
C34 Always On 可用性グループ 構築時のポイント by 小澤真之
C34 Always On 可用性グループ 構築時のポイント by 小澤真之C34 Always On 可用性グループ 構築時のポイント by 小澤真之
C34 Always On 可用性グループ 構築時のポイント by 小澤真之
Insight Technology, Inc.
 
全社情報共有サイトへの Alfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
全社情報共有サイトへのAlfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会全社情報共有サイトへのAlfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
全社情報共有サイトへの Alfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
Ryota Watabe
 
Gangliaはじめました
GangliaはじめましたGangliaはじめました
Gangliaはじめました
yuzorock
 
Always on 可用性グループ 構築時のポイント
Always on 可用性グループ 構築時のポイントAlways on 可用性グループ 構築時のポイント
Always on 可用性グループ 構築時のポイント
Masayuki Ozawa
 
Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎
Masayuki Ozawa
 
脆弱性診断とはなんぞや
脆弱性診断とはなんぞや脆弱性診断とはなんぞや
脆弱性診断とはなんぞや
mkoda
 

What's hot (20)

Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なことAlfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
 
C13 SQL Server2012知られざるTips集 by 平山理
C13 SQL Server2012知られざるTips集 by 平山理C13 SQL Server2012知られざるTips集 by 平山理
C13 SQL Server2012知られざるTips集 by 平山理
 
Share UIカスタマイズ Widget編
Share UIカスタマイズ Widget編Share UIカスタマイズ Widget編
Share UIカスタマイズ Widget編
 
C34 Always On 可用性グループ 構築時のポイント by 小澤真之
C34 Always On 可用性グループ 構築時のポイント by 小澤真之C34 Always On 可用性グループ 構築時のポイント by 小澤真之
C34 Always On 可用性グループ 構築時のポイント by 小澤真之
 
全社情報共有サイトへの Alfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
全社情報共有サイトへのAlfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会全社情報共有サイトへのAlfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
全社情報共有サイトへの Alfresco Community 5 導入事例紹介 - 第27回Alfresco勉強会
 
【de:code 2020】 Azure Synapse Analytics 技術編 ~ 最新の統合分析プラットフォームによる新しい価値の創出(後編)
【de:code 2020】 Azure Synapse Analytics 技術編 ~ 最新の統合分析プラットフォームによる新しい価値の創出(後編)【de:code 2020】 Azure Synapse Analytics 技術編 ~ 最新の統合分析プラットフォームによる新しい価値の創出(後編)
【de:code 2020】 Azure Synapse Analytics 技術編 ~ 最新の統合分析プラットフォームによる新しい価値の創出(後編)
 
Snowflake Architecture and Performance(db tech showcase Tokyo 2018)
Snowflake Architecture and Performance(db tech showcase Tokyo 2018)Snowflake Architecture and Performance(db tech showcase Tokyo 2018)
Snowflake Architecture and Performance(db tech showcase Tokyo 2018)
 
Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理
 
Replacing Your Shared Drive with Alfresco - Open Source ECM
Replacing Your Shared Drive with Alfresco - Open Source ECMReplacing Your Shared Drive with Alfresco - Open Source ECM
Replacing Your Shared Drive with Alfresco - Open Source ECM
 
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
 
Gangliaはじめました
GangliaはじめましたGangliaはじめました
Gangliaはじめました
 
Always on 可用性グループ 構築時のポイント
Always on 可用性グループ 構築時のポイントAlways on 可用性グループ 構築時のポイント
Always on 可用性グループ 構築時のポイント
 
Microsoft Azure Storage 概要
Microsoft Azure Storage 概要Microsoft Azure Storage 概要
Microsoft Azure Storage 概要
 
IT エンジニアのための 流し読み Windows 10 - Microsoft の更新プログラム管理インフラ比較 ~ WU / WSUS / SCCM ...
IT エンジニアのための 流し読み Windows 10 - Microsoft の更新プログラム管理インフラ比較 ~ WU / WSUS / SCCM ...IT エンジニアのための 流し読み Windows 10 - Microsoft の更新プログラム管理インフラ比較 ~ WU / WSUS / SCCM ...
IT エンジニアのための 流し読み Windows 10 - Microsoft の更新プログラム管理インフラ比較 ~ WU / WSUS / SCCM ...
 
Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎
 
脆弱性診断とはなんぞや
脆弱性診断とはなんぞや脆弱性診断とはなんぞや
脆弱性診断とはなんぞや
 
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか? [SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識
 
Storage and Alfresco
Storage and AlfrescoStorage and Alfresco
Storage and Alfresco
 
失敗事例で学ぶ負荷試験
失敗事例で学ぶ負荷試験失敗事例で学ぶ負荷試験
失敗事例で学ぶ負荷試験
 

Similar to Alfresco勉強会#24 コンテンツのライフサイクル

Alfrescoのバックアップとレストア
AlfrescoのバックアップとレストアAlfrescoのバックアップとレストア
Alfrescoのバックアップとレストア
Ashitaba YOSHIOKA
 
alfresco_study_4_alfresco4_solr_integration
alfresco_study_4_alfresco4_solr_integrationalfresco_study_4_alfresco4_solr_integration
alfresco_study_4_alfresco4_solr_integration
Tasuku Otani
 
Comparing GlusterFS Swift API to Native Swift
Comparing GlusterFS Swift API to Native SwiftComparing GlusterFS Swift API to Native Swift
Comparing GlusterFS Swift API to Native Swift
Etsuji Nakai
 
Gluster fs and_swiftapi_20120429
Gluster fs and_swiftapi_20120429Gluster fs and_swiftapi_20120429
Gluster fs and_swiftapi_20120429
Etsuji Nakai
 
OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門
irix_jp
 

Similar to Alfresco勉強会#24 コンテンツのライフサイクル (20)

Alfrescoのバックアップとレストア
AlfrescoのバックアップとレストアAlfrescoのバックアップとレストア
Alfrescoのバックアップとレストア
 
alfresco_study_4_alfresco4_solr_integration
alfresco_study_4_alfresco4_solr_integrationalfresco_study_4_alfresco4_solr_integration
alfresco_study_4_alfresco4_solr_integration
 
Oci file storage service deep dive 20181001 ss
Oci file storage service deep dive 20181001 ssOci file storage service deep dive 20181001 ss
Oci file storage service deep dive 20181001 ss
 
Comparing GlusterFS Swift API to Native Swift
Comparing GlusterFS Swift API to Native SwiftComparing GlusterFS Swift API to Native Swift
Comparing GlusterFS Swift API to Native Swift
 
開発者向けAlfrescoのご紹介(2013/03/27 JJUG ナイトセミナー「Java製OSS特集」発表資料)
開発者向けAlfrescoのご紹介(2013/03/27 JJUG ナイトセミナー「Java製OSS特集」発表資料)開発者向けAlfrescoのご紹介(2013/03/27 JJUG ナイトセミナー「Java製OSS特集」発表資料)
開発者向けAlfrescoのご紹介(2013/03/27 JJUG ナイトセミナー「Java製OSS特集」発表資料)
 
VarnishCache入門Rev2.1
VarnishCache入門Rev2.1VarnishCache入門Rev2.1
VarnishCache入門Rev2.1
 
Gluster fs and_swiftapi_20120429
Gluster fs and_swiftapi_20120429Gluster fs and_swiftapi_20120429
Gluster fs and_swiftapi_20120429
 
141030ceph
141030ceph141030ceph
141030ceph
 
Red Hat OpenShift Container Storage
Red Hat OpenShift Container StorageRed Hat OpenShift Container Storage
Red Hat OpenShift Container Storage
 
ACI Kubernetes Integration
ACI Kubernetes IntegrationACI Kubernetes Integration
ACI Kubernetes Integration
 
2011.09.18 v7から始めるunix まとめ
2011.09.18 v7から始めるunix まとめ2011.09.18 v7から始めるunix まとめ
2011.09.18 v7から始めるunix まとめ
 
Using docker infrastructure
Using docker infrastructureUsing docker infrastructure
Using docker infrastructure
 
そろそろSELinux を有効にしてみませんか?
そろそろSELinux を有効にしてみませんか?そろそろSELinux を有効にしてみませんか?
そろそろSELinux を有効にしてみませんか?
 
JellyBeanのソースをとりあえず眺めてみた(手抜き)
JellyBeanのソースをとりあえず眺めてみた(手抜き)JellyBeanのソースをとりあえず眺めてみた(手抜き)
JellyBeanのソースをとりあえず眺めてみた(手抜き)
 
LastaFluteに移行したFessとElasticsearch+ESFluteによるDBFlute環境
LastaFluteに移行したFessとElasticsearch+ESFluteによるDBFlute環境LastaFluteに移行したFessとElasticsearch+ESFluteによるDBFlute環境
LastaFluteに移行したFessとElasticsearch+ESFluteによるDBFlute環境
 
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
 
OpenNebula on Ubuntu
OpenNebula on UbuntuOpenNebula on Ubuntu
OpenNebula on Ubuntu
 
Dockerの仕組みとIIJ社内での利用例
Dockerの仕組みとIIJ社内での利用例Dockerの仕組みとIIJ社内での利用例
Dockerの仕組みとIIJ社内での利用例
 
OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門
 
「おれのクラウド」今日から始めるオブジェクトストレージ
「おれのクラウド」今日から始めるオブジェクトストレージ「おれのクラウド」今日から始めるオブジェクトストレージ
「おれのクラウド」今日から始めるオブジェクトストレージ
 

More from Jun Terashita

Alfresco ce 4.2の新機能
Alfresco ce 4.2の新機能Alfresco ce 4.2の新機能
Alfresco ce 4.2の新機能
Jun Terashita
 
[Alfresco]ドキュメントライブラリのUIカスタマイズ
[Alfresco]ドキュメントライブラリのUIカスタマイズ[Alfresco]ドキュメントライブラリのUIカスタマイズ
[Alfresco]ドキュメントライブラリのUIカスタマイズ
Jun Terashita
 

More from Jun Terashita (9)

Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズAlfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
 
Alfresco勉強会#33 Alfresco Solr Admin UI
Alfresco勉強会#33 Alfresco Solr Admin UIAlfresco勉強会#33 Alfresco Solr Admin UI
Alfresco勉強会#33 Alfresco Solr Admin UI
 
Alfresco勉強会#28 メタデータテンプレート
Alfresco勉強会#28 メタデータテンプレートAlfresco勉強会#28 メタデータテンプレート
Alfresco勉強会#28 メタデータテンプレート
 
Alfresco勉強会#26 Alfresco SDK + Eclipseで開発してみよう
Alfresco勉強会#26 Alfresco SDK + Eclipseで開発してみようAlfresco勉強会#26 Alfresco SDK + Eclipseで開発してみよう
Alfresco勉強会#26 Alfresco SDK + Eclipseで開発してみよう
 
Alfresco勉強会#21 Alfresco Workdesk Configuratorによるpluginの設定変更方法
Alfresco勉強会#21 Alfresco Workdesk Configuratorによるpluginの設定変更方法Alfresco勉強会#21 Alfresco Workdesk Configuratorによるpluginの設定変更方法
Alfresco勉強会#21 Alfresco Workdesk Configuratorによるpluginの設定変更方法
 
Alfrescoのカスタムテーブルの使い方
Alfrescoのカスタムテーブルの使い方Alfrescoのカスタムテーブルの使い方
Alfrescoのカスタムテーブルの使い方
 
Alfresco ce 4.2の新機能
Alfresco ce 4.2の新機能Alfresco ce 4.2の新機能
Alfresco ce 4.2の新機能
 
[Alfresco]ドキュメントライブラリのUIカスタマイズ
[Alfresco]ドキュメントライブラリのUIカスタマイズ[Alfresco]ドキュメントライブラリのUIカスタマイズ
[Alfresco]ドキュメントライブラリのUIカスタマイズ
 
[Alfresco]Custom Modelの作成
[Alfresco]Custom Modelの作成[Alfresco]Custom Modelの作成
[Alfresco]Custom Modelの作成
 

Recently uploaded

2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
ssuserbefd24
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance
 

Recently uploaded (14)

LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
 
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdfFIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
 
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdfFIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdf
 
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdfFIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
 
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
 
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdfFIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
 
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
 
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
 

Alfresco勉強会#24 コンテンツのライフサイクル

  • 1. © 2014 aegif 第24回 Alfresco勉強会 コンテンツのライフサイクル 2014年10月15日 Jun Terashita
  • 3. © 2014 aegif (準備)Alfrescoのリポジトリを構成する要素 ファイルシステム(FS) ファイル実体。デフォルトでは以下のディレクトリに保存される。 ・<install_dir>/alf_data/conetntstore データベース(DB) コンテンツの属性情報やアソシエーション等、詳細情報が記録される。 今回の内容で関係があるのは主に以下のテーブル。 ・alf_node ・alf_node_properties ・alf_content_data ・alf_content_url Luceneインデックス(IDX) 検索用のインデックス。なくなっても上記の2つからリビルドすることが可能。 デフォルトでは以下のディレクトリに保存される(Solrを選択した場合)。 ・<install_dir>/alf_data/solr/workspace/SpacesStore/index/ ・<install_dir>/alf_data/solr/archive/SpacesStore/index 3
  • 4. 5. DBのクリーニング © 2014 aegif ライフサイクルの全体像 4 1. コンテンツ作成 1 2. コンテンツ削除 3. ごみ箱から削除 4. FSのクリーニング 2 3 4 5 14日(default) 30日(default) FS contentstore contentstote contentstore contentstore.deleted contentstore.deleted DB alf_node alf_node.properties alf_content_data alf_content_url alf_node alf_node.properties alf_content_data alf_content_url alf_node alf_node.properties alf_content_url alf_node alf_node_properties ー (※) IDX workspace/ SpacesStore archive/ SpacesStore ーーー (※)関連レコードが存在するテーブルは他にもありますが主なテーブルのみ記載しています。
  • 5. © 2014 aegif 1. コンテンツ作成 ブラウザでAlfresco Shareを開き、適当なフォルダにコンテンツを作成する。 ノードブラウザで確認すると以下のようにファイル実体のパスやUUID、DBIDが確認できる。 5 DBID UUID ファイル実体のパス ストア
  • 6. FS <install_dir>/alf_data/conetntstore 以下に日付で区切られたフォルダが作成され、そこにリネームし て保存される(リネーム後のファイル名とノードのUUIDは別物である点に注意)。 © 2014 aegif 1. コンテンツ作成 6
  • 7. DB alf_nodeテーブルから、alf_node_properties → alf_contente_data → alf_content_urlとたどり、 ファイル実体のパスまで確認できる。 alf_node © 2014 aegif 1. コンテンツ作成 7 alf_node_properties qname_idがcm:contentのレコード
  • 8. © 2014 aegif 1. コンテンツ作成 8 alf_content_data alf_content_url ファイル実体のパス
  • 10. © 2014 aegif 2. コンテンツ削除 Alfresco ShareのUIから1で作成したコンテンツを削除する。 1と同様にノードブラウザから確認できる(ただし、ストアがarchiveになっている)。 10 DBID ファイル実体のパス UUID ストア
  • 11. © 2014 aegif 2. コンテンツ削除 11 FS 変化なし。同じディレクトリに存在する。
  • 12. © 2014 aegif 2. コンテンツ削除 DB alf_nodeテーブルのレコードが以下の2つになる。 ・store_idが「archive/SpacesStore」で、type_qname_idが「cm:content」 ・store_idが「workspace/SpacesStore」で、type_qname_idが「sys:deleted」 alf_node alf_node_properties、alf_content_dataの関連レコードはidが変わる。 ただし、alf_content_urlの関連レコードはidもそのまま。 (スクリーンショットは割愛します) 12
  • 13. © 2014 aegif 2. コンテンツ削除 IDX archive/SpacesStore/indexの中にDBIDが一致するインデックスが見つかる(workspace/ SpacesStore/index の中には見つからない)。 13
  • 14. © 2014 aegif 3. ごみ箱から削除 ユーザプロファイルページからごみ箱を開き、コンテンツを削除する。 ※この時点でノードブラウザからは確認できなくなる。 14 FS 変化なし。同じディレクトリに存在する。
  • 15. © 2014 aegif 3. ごみ箱から削除 DB alf_nodeテーブルのstore_idが「archive/SpacesStore」だったレコードのtype_qname_idが 「sys:deleted」に変わる。 alf_node_propertiesにはoriginal idを保持するレコードがそれぞれ1つずつ。 alf_content_dataの関連レコードは削除される。 alf_content_urlの関連レコードはorphan_timeにごみ箱を空にした時刻が記録される。 15 alf_node alf_content_url
  • 16. © 2014 aegif 3. ごみ箱から削除 IDX このタイミングでインデックスから完全に削除される。 16
  • 17. contentStoreCleanerが定期的に実行され、alf_content_urlテーブルのorphan_timeか ら一定期間経過しているファイル実体を、contentstoreからcontentstore.deletedに移 動する。 contentStoreCleanerのbean定義は、content-services-context.xmlを参照。 これを発火するのがcontentStoreCleanerTriggerとcontentStoreCleanerJobDetailで、scheduled-jobs- © 2014 aegif 4. FSのクリーニング context.xmlに定義されている。 また、実行タイミングとorphan_timeからの保持期間はrepository.propertiesで設定されている。 … # # Decide if content should be removed from the system immediately after being orphaned. # Do not change this unless you have examined the impact it has on your backup procedures. system.content.eagerOrphanCleanup=false # The number of days to keep orphaned content in the content stores. # This has no effect on the 'deleted' content stores, which are not automatically emptied. system.content.orphanProtectDays=14 # The action to take when a store or stores fails to delete orphaned content # IGNORE: Just log a warning. The binary remains and the record is expunged # KEEP_URL: Log a warning and create a URL entry with orphan time 0. It won't be processed or removed. system.content.deletionFailureAction=IGNORE # The CRON expression to trigger the deletion of resources associated with orphaned content. system.content.orphanCleanup.cronExpression=0 0 4 * * ? … 17 repository.properties (補足)
  • 18. FS ファイル実体がcontentstoreからcontentstore.deletedに移される。以降、contentstore.deletedの 中身は自由に削除してよい。 © 2014 aegif 4. FSのクリーニング DB alf_nodeおよびalf_node_propertiesは変化なし。 alf_content_urlから関連レコードが削除される。 IDX 「3. ごみ箱から削除」の時点でインデックスから削除されているため変化なし。 18
  • 19. DeletedNodeCleanupWorkerが定期的に実行され、alf_nodeその他のテーブルのレコー ドを削除する。 ここでは、alf_nodeでsys:deletedになっているレコードに対応するalf_transactionテー ブルのcommit_time_msが一定期間経過しているものを抽出している。 (補足) scheduled-jobs-context.xmlにnodeServiceCleanupJobDetailとnodeServiceCleanupTriggerのbean 定義があり、cronExpressionはbean定義に直接書かれている。 また、ごみ箱を空にしてからの保持期間は、repository.propertiesに設定されている。 © 2014 aegif 5. DBのクリーニング … # Index tracking information of a certain age is cleaned out by a scheduled job. # Any clustered system that has been offline for longer than this period will need to be seeded # with a more recent backup of the Lucene indexes or the indexes will have to be fully rebuilt. # Use -1 to disable purging. This can be switched on at any stage. index.tracking.minRecordPurgeAgeDays=30 # Unused transactions will be purged in chunks determined by commit time boundaries. 'index.tracking.purgeSize' specifies the size # of the chunk (in ms). Default is a couple of hours. index.tracking.purgeSize=7200000 … 19 repository.properties
  • 20. FS 「4. FSのクリーニング」の時点でファイル実体がcontentstoreからcontentstore.deletedに移されて いるため変化なし。 DB alf_node、alf_node_properties、alf_transaction等から関連レコードが削除される。 © 2014 aegif 5. DBのクリーニング IDX 「3. ごみ箱から削除」の時点でインデックスから削除されているため変化なし。 20
  • 21. 5. DBのクリーニング © 2014 aegif (再掲)ライフサイクルの全体像 21 1. コンテンツ作成 1 2. コンテンツ削除 3. ごみ箱から削除 4. FSのクリーニング 2 3 4 5 14日(default) 30日(default) FS contentstore contentstote contentstore contentstore.deleted contentstore.deleted DB alf_node alf_node.properties alf_content_data alf_content_url alf_node alf_node.properties alf_content_data alf_content_url alf_node alf_node.properties alf_content_url alf_node alf_node_properties ー (※) IDX workspace/ SpacesStore archive/ SpacesStore ーーー (※)関連レコードが存在するテーブルは他にもありますが主なテーブルのみ記載しています。
  • 22. 「4. FSのクリーニング」までファイルをcontentstoreに保持する理由 ・ファイルを一定期間contentstoreに保持することによって、DBとインデックスをバックアップからリ ストアする際に、ファイルシステムのリストアをする必要がなくなるため。 ・コンテンツ数が増えてくるとファイルシステムのリストアには時間がかかるため、時間の節約になる。 ・当然、DBとインデックスのバックアップは(デフォルトでは)14日以内のものである必要がある。 「5. DBのクリーニング」までalf_node等のレコードを保持する理由 ・インデックスの差分リビルドの際に、インデックスのバックアップ作成時点から削除されたコンテン ツのインデックスを削除するため。 ・インデックスの差分リビルドにはalf_transactionテーブルに記録されたトランザクションを参照して おり、alf_transactionとalf_nodeが繋がっているため、レコードが消えているとインデックスの更新が できなくなる。 ・当然、インデックスのバックアップは(デフォルトでは)30日以内のものである必要がある。 © 2014 aegif すぐに削除しない理由 22
  • 23. © 2014 aegif おわり