Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Geometry::estimateMemorySize() API #156

Closed
mbasmanova opened this issue Feb 28, 2018 · 15 comments
Closed

Add Geometry::estimateMemorySize() API #156

mbasmanova opened this issue Feb 28, 2018 · 15 comments

Comments

@mbasmanova
Copy link
Contributor

I'm using ESRI Geometry API to provide geospatial query support in Presto ( https://prestodb.io/ ) and I need to calculate how much memory individual Geometry objects occupy. I'm using ClassLayout.parseClass to compute the base size of an object and then add on sizes of arrays, lists, etc. I need to be able to write this code:

private static final int MULTI_POINT_IMPL_INSTANCE_SIZE = ClassLayout.parseClass(MultiPointImpl.class).instanceSize();
private static final int MULTI_PATH_IMPL_INSTANCE_SIZE = ClassLayout.parseClass(MultiPathImpl.class).instanceSize();

(see https://github.com/prestodb/presto/pull/9474/files#diff-ac9e6026ae8bd12a435b09b61a5cc0fa)

But I can't because MultiPointImpl and MultiPathImpl classes are package private.

Would it be possible to make them public?

@stolstov
Copy link
Member

If are working on this, would you be willing to add an abstract method to the Geometry class and other classes as needed called estimateMemorySize() that returns the size of the geometry instance in memory?

@stolstov
Copy link
Member

      /**
      * Calculates approximate size of the structure in memory including all the data it holds.
      * @return size in bytes.
      */

@mbasmanova
Copy link
Contributor Author

@stolstov Sergey, thanks for a quick response. Absolutely, I'd be happy to work on a PR to add estimateMemorySize() to the Geometry objects. Is there anything I should be aware of/read about before starting?

@stolstov
Copy link
Member

@mbasmanova That would be great if you could add those methods. Please, use same formatting as we do, and read CONTRIBUTING.md (which is basically a link to this https://github.com/esri/contributing) for the legal info.

@mbasmanova mbasmanova changed the title Make MultiPointImpl and MultiPathImpl classes public Add Geometry::estimateMemorySize() API Mar 2, 2018
@mbasmanova
Copy link
Contributor Author

@stolstov Sergey, PR #157 adds the new API. Would you take a look?

@stolstov
Copy link
Member

stolstov commented Mar 5, 2018

@alocke Could you verify this?

@alocke
Copy link
Member

alocke commented Mar 6, 2018

Yes, I will.

@mbasmanova
Copy link
Contributor Author

@alocke Annette, I'd like to use the new API in Presto https://prestodb.io/ . Do you have an idea of when a new release might be available?

@alocke
Copy link
Member

alocke commented Mar 16, 2018

@mbasmanova Thank you. Verified.

@alocke alocke closed this as completed Mar 16, 2018
@mbasmanova
Copy link
Contributor Author

@alocke Thank you, Annette! What are the next steps?

@alocke
Copy link
Member

alocke commented Mar 19, 2018

@mbasmanova Thank you!
@randallwhitman What are the next steps?

@randallwhitman
Copy link
Contributor

@mbasmanova
Copy link
Contributor Author

@randallwhitman Randall, thanks for releasing the new version. Will it appear on Maven Central automatically within a short period of time or is something else necessary to make this happen?

https://mvnrepository.com/artifact/com.esri.geometry/esri-geometry-api

@randallwhitman
Copy link
Contributor

I ran mvn deploy -Prelease -DperformRelease=true; we'll have to see if the files propagate versus if I get stuck like - Esri/spatial-framework-for-hadoop#123

@mbasmanova
Copy link
Contributor Author

@randallwhitman Randall, I see 2.1.0 release in Maven central: https://mvnrepository.com/artifact/com.esri.geometry/esri-geometry-api/2.1.0

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants