parallelStream() at your own risk

 Java, Programming, Work  Comments Off on parallelStream() at your own risk
Jun 262017
 

Java 8 introduced a lot of cool features, 1 of the most useful of which was the stream() method. This nifty little method lets you treat an Iterable as a stream, enabling cool things like lambdas operating over a list. Related to stream() is parallelStream(). This lets you group your stream into smaller streams that are run in, you guessed it, parallel. Specifically, your data is processed in a thread pool the size of the number of cores on your machine, minus the one running your app. That’s a handy piece of information you’re going to want to keep in mind before you start throwing this nifty little call around in your code.  Continue reading »

 Posted by at 2:44 pm

Keeping a ledger on technical debt

 General Commentary, Programming  Comments Off on Keeping a ledger on technical debt
Feb 052017
 

Software development is all about making tradeoffs. Sometimes, we do stuff because it’s quicker and get things out of the door faster, not because it’s the best option long-term. Do software development long enough, and you’ll learn the term “technical debt” – which is formally defined on Wikipedia as “a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution”. A more informal, but probably just as accurate definition could also be “the price(s) you’re paying now to have shipped things earlier.” Here’s the thing, most of the time we do something that incurs technical debt, we know it then. It’d be nice if there’s a way for us to log the decisions we made, and the debt we incurred so we can factor it into planning and regular development work, instead of trying to pay it off when there’s no other alternative.

Continue reading »

 Posted by at 2:18 am

Debugging a performance bottleneck

 Java, Programming, Work  Comments Off on Debugging a performance bottleneck
Sep 302016
 

Recently, we had a Kinesis consumer back up due to a deployment problem. Sadly, this problem went on for 2 days without us noticing, so we were pretty backed up. Now in theory, we should have been able to catch back up to real-time data sometime later that calendar day. In reality, we fell 2 days behind and it took us 2 days to catch up. That’s not acceptable, and I wanted to document the list of things we tried and how well they worked and to document our process for looking for the bottleneck. Obviously, there’s tons of room for improvement in the code, but there’s also a lot of room for improvement in how we were doing things before, and probably a lot of room for in how we went about trying to fix the issue.

Continue reading »

 Posted by at 10:00 pm
Aug 292016
 

APIs are tricky things to maintain. Because they’re designed to be open by nature, it’s hard to test every possible way someone could use it. That makes incredibly easy to break if you don’t think through any changes you’re making carefully, with an emphasis on what a developer is expecting. Luckily, there are a few things you can do to limit the amount of times you inadvertently break a bunch of applications with a well-meaning API update.

Continue reading »

 Posted by at 11:33 pm

All hail managed services (or at least good VM automation)

 General Commentary, Java, Programming, Work  Comments Off on All hail managed services (or at least good VM automation)
Aug 022016
 

I transferred teams at work recently, and spent about a week trying to get their code running on my laptop so I can do useful development work. This is in addition to trying to wrap my head around the existing codebase and figuring out how to test my changes. It’s not that the code is bad, it’s just getting all the ****ing components hooked up, communicating with each other, and playing nicely together an exercise in impossibility. Coming from a group that ran everything in AWS, going back to managing all the third-party services in a development environment makes me want to flip my desk over and start screaming about what the **** is wrong with everyone.

Continue reading »

 Posted by at 12:41 am
May 272016
 

You’re sitting there at work and word reaches you that your application is misbehaving. What’s the first thing you do? Pull up the logs and see what they say. And this is where you may wish that you had an entire class in school dedicated to the art of writing useful log messages. Good logging is an art, and it’s 1 that most of us don’t learn until we’re stuck trying to diagnose something in the wild with subpar messages to guide us.

Continue reading »

 Posted by at 12:34 am

Campus Navigator updated

 Programming, Projects, Shenanigans  Comments Off on Campus Navigator updated
Jan 012016
 

So I hadn’t touched Campus Navigator since it was first released in February 2013. Elon University, which I used for my sample implementation, has changed a lot in the nearly 3 years since I published that example, so I spent a little time during the Christmas down period updating that reference implementation, which is now live.

Continue reading »

 Posted by at 1:42 pm
Aug 082015
 

My last post about mocking a Netty server using Mockito worked for Netty 3.x, but the changes made in Netty 4.0 broke a lot of that work. After spending some quality time reading up on the changes from 3 to 4 and debugging my testing code, I got my mocked Netty server working with Netty 4.0, and now I’m posting it here in the hopes it helps anyone else who’s looking to mock a current Netty server for their unit tests.  Continue reading »

 Posted by at 12:04 pm

The case of the dead dispatcher

 Java, Programming, Work  Comments Off on The case of the dead dispatcher
Jul 232015
 

A while back at work, we noticed a periodic issue where remote jobs just weren’t being run. That was being caused by the fact that the jobs weren’t actually being sent to the remote AWS instances that were meant to be running said jobs. Just why the jobs weren’t being sent out was a mystery, but a simple bouncing of either the remote servers or the main application itself seemed to get things moving again. In the meantime, we were off on a hunt for just why these jobs were no longer getting dispatched.

Continue reading »

 Posted by at 7:30 am