SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Accumulo 2.0.0
A New Client API
Christopher Tubbs
Versions Overview
● Retired
○ 1.3 (last: 1.3.6)
○ 1.4 (last: 1.4.5)
● Current
○ 1.5 (latest: 1.5.2)*
○ 1.6 (latest: 1.6.2)
○ 1.7 ?
● Development
○ 1.8
○ 2.0
Version Philosophy
Old
1.x.y
x: major*
y: minor/bugfixes*
* habit of removing
deprecated code arbitrarily
New (1.6.2+)
x.y.z
x: major
y: minor
z: patch (bugfix)
Semantic Versioning 2.0
(http://semver.org/)
Background: 1.x API
● Focus (or lack thereof)
○ Function > Usability
○ Limited forethought for integration
● Current API
○ a gradual evolution
○ biggest redesign in 2009
■ Instance / Connector
■ Permissions / Authenticator
○ lots of feature additions, deprecations, removals, but
few fundamental design changes since
Background: 1.x API (cont.)
Public API
● public and protected
○ in org.apache.accumulo.core.client
■ everything but impl packages
○ in org.apache.accumulo.core.data
■ Key, Mutation, Value, Range
■ Condition and ConditionalMutation (1.6+)
○ in org.apache.accumulo.minicluster
■ everything but impl packages
Background: 1.x API (cont.)
Public API (1.7)
● public and protected
○ org.apache.accumulo.core.client
○ org.apache.accumulo.core.data
○ org.apache.accumulo.core.security
○ org.apache.accumulo.minicluster
● all but
○ *impl*, *thrift*, *crypto*
Lessons Learned
1. Confusing entry point
Instance i = new ZooKeeperInstance(…);
Connector c;
// c = new Connector(i, user, pass);
c = i.getConnector(user, pass);
2. Too many overloaded methods
BatchWriterConfig bwConf;
bwConf = new BatchWriterConfig();
bw = c.createBatchWriter(table, bwConf);
What’s Better?
Perhaps:
AccumuloClient.Builder builder =
Accumulo.client();
builder.setXXXX(…);
AccumuloClient c = builder.build();
Better Yet...
...make it fluent:
AccumuloClient client =
Accumulo.client().setXXXX(…).build();
1. More factories
2. More configuration containers / builders
3. Fluent
Resource Management
Current Problems:
● private static fields shared by clients
● no ability to close / clean up
● performance trade-offs
Opaque Resources
Better:
try (
AccumuloClient.Resources r =
Accumulo.clientResources();
AccumuloClient client =
Accumulo.client().with(r).build()) {
/* do work with the client */
} catch (Exception e) { … }
What About Exceptions?
Current Problems:
... throws TableNotFoundException,
AccumuloSecurityException,
AccumuloException;
With Java 7, this gets a little better:
catch (AccumuloSecurityException |
AccumuloException e) { … }
Exception Hierarchy
Better:
public class TableNotFound
extends AccumuloException {}
--------------------------------------------
try (
AccumuloClient client =
Accumulo.client().build()) {
/* do work with the client */
} catch (AccumuloException e) {
…
} catch (YourCodeException e) {…}
Leaking
Current Problems:
● Leaking non-public (implementation) classes
○ apilyzer-maven-plugin
○ Problem: requires users to instantiate, assign, or
pass non-public classes in normal use
● Exposing too much implementation
○ MapReduce classes
○ Problem: makes it difficult to extend or evolve
internal changes without affecting users.
Dependency Exposure
Current Problems:
● Dependencies on unstable third-party
classes
○ Guava “@Beta”-annotated classes
○ Hadoop “@LimitedPrivate”-annotated classes
● Dependencies with lots of transitive deps
○ Hadoop “Text”,
○ “Writable” for serialization
● RPC serialization library in public API
○ Thrift
Parameter Problems
Current Problems:
● Exposing implementation-specific classes
○ log4j “Level”
○ prevents using log4j2, slf4j, and logback
● “stringly” typed objects parameters
○ table
○ tableName
○ tableId
Encoding Problems
Current Problems:
● Fail to specify internal encoding
● serialize/deserialize mismatch
● UTF-8 or user-specified?
● Overloaded methods again
● Unexpected characters (Authorizations)
● The Accumulo shell (jline)
New Types
● Namespace
○ .getId()
○ .exists()
○ .tables()
○ .rename(String)
● Table
○ .getSplits()
○ .merge(Range)
○ .scanner(ScanOptions)
○ .compact()
API-only Artifact
● accumulo-api.jar (new!)
○ org.apache.accumulo.api
○ no dependencies on other accumulo jars
■ use Java’s ServiceLoader to bind to impl
○ minimal dependencies on stable libraries
■ commons
■ guava
● Not in accumulo-core.jar
2.0.0 API Statement
Public API (new!)
● public and protected
○ org.apache.accumulo.api
Alternatively:
● public and protected
○ accumulo-api.jar
Goals: A Summary
● Improved API stability
● Compatibility (semver)
○ Easy to check
○ Easy to track changes
● Helps users manage dependencies
● Separate API from implementation
● Possible ability to swap out implementation
(mock replacement? in-process impl?)
● Intuitive “front-door”
● Fluent usage
● Resource management
Release plan
Steps
● Finish implementation
● Initial reviews
● 2.0.0-alpha-1
○ Developer preview released to get feedback
● 2.0.0-beta-1 ?
○ Possibly another developer preview after stabilizing
API changes
● 2.0.0 final release (Summer?)
Contact
Me:
ctubbsii@apache.org
GPG Fingerprint: 8CC4 F8A2 B29C 2B04 0F2B 835D 6F0C DAE7 00B6 899D
Us:
user@accumulo.apache.org
dev@accumulo.apache.org
#accumulo on FreeNode IRC
Issue:
https://issues.apache.org/jira/browse/ACCUMULO-2589

Contenu connexe

Similaire à Accumulo Summit 2015: Accumulo 2.0: A New Client API [API]

CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornMichel Graciano
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchDataStax Academy
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationstakezoe
 
Flink and Hive integration - unifying enterprise data processing systems
Flink and Hive integration - unifying enterprise data processing systemsFlink and Hive integration - unifying enterprise data processing systems
Flink and Hive integration - unifying enterprise data processing systemsBowen Li
 
Unify Enterprise Data Processing System Platform Level Integration of Flink a...
Unify Enterprise Data Processing System Platform Level Integration of Flink a...Unify Enterprise Data Processing System Platform Level Integration of Flink a...
Unify Enterprise Data Processing System Platform Level Integration of Flink a...Flink Forward
 
Architecting the Future: Abstractions and Metadata - STL SilverLinings
Architecting the Future: Abstractions and Metadata - STL SilverLiningsArchitecting the Future: Abstractions and Metadata - STL SilverLinings
Architecting the Future: Abstractions and Metadata - STL SilverLiningsDaniel Barker
 
FrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitFrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitContrext Solutions
 
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor EditionAd102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor Editionddrschiw
 
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...NETWAYS
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectIgalia
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kiteChristian Opitz
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
Architecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockArchitecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockDaniel Barker
 
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13Dominopoint - Italian Lotus User Group
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntfUlrich Krause
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingJulien Pivotto
 
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019TomBarron
 
GitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by ScalaGitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by Scalatakezoe
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization releaseESUG
 

Similaire à Accumulo Summit 2015: Accumulo 2.0: A New Client API [API] (20)

CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project Nashorn
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applications
 
Flink and Hive integration - unifying enterprise data processing systems
Flink and Hive integration - unifying enterprise data processing systemsFlink and Hive integration - unifying enterprise data processing systems
Flink and Hive integration - unifying enterprise data processing systems
 
Unify Enterprise Data Processing System Platform Level Integration of Flink a...
Unify Enterprise Data Processing System Platform Level Integration of Flink a...Unify Enterprise Data Processing System Platform Level Integration of Flink a...
Unify Enterprise Data Processing System Platform Level Integration of Flink a...
 
Architecting the Future: Abstractions and Metadata - STL SilverLinings
Architecting the Future: Abstractions and Metadata - STL SilverLiningsArchitecting the Future: Abstractions and Metadata - STL SilverLinings
Architecting the Future: Abstractions and Metadata - STL SilverLinings
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
FrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitFrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open Toolkit
 
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor EditionAd102 - Extreme Makeover -- LotusScript and Java Editor Edition
Ad102 - Extreme Makeover -- LotusScript and Java Editor Edition
 
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium project
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Architecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStockArchitecting the Future: Abstractions and Metadata - CodeStock
Architecting the Future: Abstractions and Metadata - CodeStock
 
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019
Manila Project Onboarding - Denver Open Infrastructure Summit - May 2019
 
GitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by ScalaGitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by Scala
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization release
 

Dernier

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Dernier (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Accumulo Summit 2015: Accumulo 2.0: A New Client API [API]

  • 1. Accumulo 2.0.0 A New Client API Christopher Tubbs
  • 2. Versions Overview ● Retired ○ 1.3 (last: 1.3.6) ○ 1.4 (last: 1.4.5) ● Current ○ 1.5 (latest: 1.5.2)* ○ 1.6 (latest: 1.6.2) ○ 1.7 ? ● Development ○ 1.8 ○ 2.0
  • 3. Version Philosophy Old 1.x.y x: major* y: minor/bugfixes* * habit of removing deprecated code arbitrarily New (1.6.2+) x.y.z x: major y: minor z: patch (bugfix) Semantic Versioning 2.0 (http://semver.org/)
  • 4. Background: 1.x API ● Focus (or lack thereof) ○ Function > Usability ○ Limited forethought for integration ● Current API ○ a gradual evolution ○ biggest redesign in 2009 ■ Instance / Connector ■ Permissions / Authenticator ○ lots of feature additions, deprecations, removals, but few fundamental design changes since
  • 5. Background: 1.x API (cont.) Public API ● public and protected ○ in org.apache.accumulo.core.client ■ everything but impl packages ○ in org.apache.accumulo.core.data ■ Key, Mutation, Value, Range ■ Condition and ConditionalMutation (1.6+) ○ in org.apache.accumulo.minicluster ■ everything but impl packages
  • 6. Background: 1.x API (cont.) Public API (1.7) ● public and protected ○ org.apache.accumulo.core.client ○ org.apache.accumulo.core.data ○ org.apache.accumulo.core.security ○ org.apache.accumulo.minicluster ● all but ○ *impl*, *thrift*, *crypto*
  • 7. Lessons Learned 1. Confusing entry point Instance i = new ZooKeeperInstance(…); Connector c; // c = new Connector(i, user, pass); c = i.getConnector(user, pass); 2. Too many overloaded methods BatchWriterConfig bwConf; bwConf = new BatchWriterConfig(); bw = c.createBatchWriter(table, bwConf);
  • 8. What’s Better? Perhaps: AccumuloClient.Builder builder = Accumulo.client(); builder.setXXXX(…); AccumuloClient c = builder.build();
  • 9. Better Yet... ...make it fluent: AccumuloClient client = Accumulo.client().setXXXX(…).build(); 1. More factories 2. More configuration containers / builders 3. Fluent
  • 10. Resource Management Current Problems: ● private static fields shared by clients ● no ability to close / clean up ● performance trade-offs
  • 11. Opaque Resources Better: try ( AccumuloClient.Resources r = Accumulo.clientResources(); AccumuloClient client = Accumulo.client().with(r).build()) { /* do work with the client */ } catch (Exception e) { … }
  • 12. What About Exceptions? Current Problems: ... throws TableNotFoundException, AccumuloSecurityException, AccumuloException; With Java 7, this gets a little better: catch (AccumuloSecurityException | AccumuloException e) { … }
  • 13. Exception Hierarchy Better: public class TableNotFound extends AccumuloException {} -------------------------------------------- try ( AccumuloClient client = Accumulo.client().build()) { /* do work with the client */ } catch (AccumuloException e) { … } catch (YourCodeException e) {…}
  • 14. Leaking Current Problems: ● Leaking non-public (implementation) classes ○ apilyzer-maven-plugin ○ Problem: requires users to instantiate, assign, or pass non-public classes in normal use ● Exposing too much implementation ○ MapReduce classes ○ Problem: makes it difficult to extend or evolve internal changes without affecting users.
  • 15. Dependency Exposure Current Problems: ● Dependencies on unstable third-party classes ○ Guava “@Beta”-annotated classes ○ Hadoop “@LimitedPrivate”-annotated classes ● Dependencies with lots of transitive deps ○ Hadoop “Text”, ○ “Writable” for serialization ● RPC serialization library in public API ○ Thrift
  • 16. Parameter Problems Current Problems: ● Exposing implementation-specific classes ○ log4j “Level” ○ prevents using log4j2, slf4j, and logback ● “stringly” typed objects parameters ○ table ○ tableName ○ tableId
  • 17. Encoding Problems Current Problems: ● Fail to specify internal encoding ● serialize/deserialize mismatch ● UTF-8 or user-specified? ● Overloaded methods again ● Unexpected characters (Authorizations) ● The Accumulo shell (jline)
  • 18. New Types ● Namespace ○ .getId() ○ .exists() ○ .tables() ○ .rename(String) ● Table ○ .getSplits() ○ .merge(Range) ○ .scanner(ScanOptions) ○ .compact()
  • 19. API-only Artifact ● accumulo-api.jar (new!) ○ org.apache.accumulo.api ○ no dependencies on other accumulo jars ■ use Java’s ServiceLoader to bind to impl ○ minimal dependencies on stable libraries ■ commons ■ guava ● Not in accumulo-core.jar
  • 20. 2.0.0 API Statement Public API (new!) ● public and protected ○ org.apache.accumulo.api Alternatively: ● public and protected ○ accumulo-api.jar
  • 21. Goals: A Summary ● Improved API stability ● Compatibility (semver) ○ Easy to check ○ Easy to track changes ● Helps users manage dependencies ● Separate API from implementation ● Possible ability to swap out implementation (mock replacement? in-process impl?) ● Intuitive “front-door” ● Fluent usage ● Resource management
  • 22. Release plan Steps ● Finish implementation ● Initial reviews ● 2.0.0-alpha-1 ○ Developer preview released to get feedback ● 2.0.0-beta-1 ? ○ Possibly another developer preview after stabilizing API changes ● 2.0.0 final release (Summer?)
  • 23. Contact Me: ctubbsii@apache.org GPG Fingerprint: 8CC4 F8A2 B29C 2B04 0F2B 835D 6F0C DAE7 00B6 899D Us: user@accumulo.apache.org dev@accumulo.apache.org #accumulo on FreeNode IRC Issue: https://issues.apache.org/jira/browse/ACCUMULO-2589