0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GAE/Javaでデータストアの使用しなくなったインデックスを削除

Last updated at Posted at 2017-01-18

Google App EngineをJavaで使っている場合のindexの削除方法

Deleting unused indexes参照
https://cloud.google.com/appengine/docs/java/config/indexconfig

Macのターミナルからappcfg.shを実行
./appengine-java-sdk/bin/appcfg.sh vacuum_indexes myapp/war

datastore-indexes.xmlまたはdatastore-indexes-auto.xmlに記載のないものを削除するかどうかひとつずつ聞かれるので返答していく。実行終了後は何もしなくてもデータストアのインデックス管理画面で削除中の表示になり、さらに待つと5分後くらいに消えた。

appcfg.shの場所
/eclipse/plugins/com.google.appengine.eclipse.sdkbundle/appengine-java-sdk/bin

フルパスまたはディレクトリを移動して./appcfg.sh vacuum_indexes myapp/war

myapp/warの方はプロジェクトのwarフォルダでOK

Permission deniedがでたらchmod +x appcfh.shで権限を付与

bin/run_java.sh: Permission deniedがでたら再度chmod +x run_java.sh

実行できると、ブラウザが起動しデータアクセスを許可する画面とコードが出でくるのでコピペで入力

********************************************************
Please enter code:

しばらくすると、どんどん聞かれる

This index is no longer in your datastore-indexes.xml file:

<datastore-index kind="RepObject" ancestor="false">
    <property name="ctgId" direction="asc"/>
    <property name="divider" direction="asc"/>
    <property name="obIndex" direction="desc"/>
</datastore-index>

Are you sure you want to delete this index? (N/y/a): y

すべて答えれば終了

vacuum_indexes completed successfully.
Success.
Cleaning up temporary files for module default...
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?