Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] How to avoid Tablet Server crashing, and server cost problem...

Hi Emilio,

Thank you for teaching me an effective way.

I will consider remodeling the program.

Takashi


>Hi Takashi,
>
>One way to possibly improve performance is to use an optimized delete. The FeatureStore delete method queries each feature and then deletes it - instead, you could just do a batch delete on the whole table (note: this assumes that you do not have other schemas sharing the table).
>
>in scala:
>
>val ds = dataStore.asInstanceOf[org.locationtech.geomesa.accumulo.data.AccumuloDataStore]
> val tables = org.locationtech.geomesa.accumulo.data.tables.GeoMesaTable.getTables(sft)
> val tableNames = tables.map(table => ds.getTableName(typeName, table))
> tableNames.par.foreach { table =>
> val deleter = ds.connector.createBatchDeleter(table, ...)
> deleter.setRanges(List(new Range()))
> deleter.delete()
> deleter.close()
> }
>
>since you're just using the Z2 index, you may be able to simplify this to:
>
>val tableName = ds.getTableName(typeName, org.locationtech.geomesa.accumulo.data.tables.Z2Table)
> // delete the single table
>
>I've also created a ticket so that we can detect this case and handle it automatically.
>
>Thanks,
>
>Emilio
>
>>On 12/14/2016 10:53 PM, Takashi Sasaki wrote:
>>Hi Emilio,
>>
>>I understood detail of generateStats and collectQueryStats and decided
>>to disable them.
>>
>>
>>When you delete your data, how are you doing it?
>>It's easy way, the code is below.
>>--
>>private void deleteFeatures(String simpleFeatureTypeName, DataStore
>>dataStore) throws IOException {
>>  FeatureStore featureStore = (SimpleFeatureStore)
>>dataStore.getFeatureSource(simpleFeatureTypeName);
>>  featureStore.removeFeatures(Filter.INCLUDE);
>>  dataStore.dispose();
>>}
>>--
>>
>>I wanted to choice Kafka, but abandoned it due to some application
>>specification...
>>(I can not say it in detail because of internal confidentiality)
>>
>>
>>I tried to use only z2 index, I felt it improved somewhat.
>>
>>
>>Thank you for reply,
>>
>>Takashi


Back to the top