gRPC Timeouts & Deadlines

First, let’s figure out how the timeout differs from the deadline. Timeout is relative value, but deadline is absolute. If we take a timeout and a deadline of 5 seconds, and we will write the following line (the code for an example, it will not work if you run it): Then, if you want to […]

READ MORE

gRPC channel for target was not shutdown properly

Imagine you are faced with an error like this: The point is that if you create a gRPC channel, you must close it after use. Let’s say you’ve already made a channel like this: After use, it will need to be closed. It is important to wait until it closes; awaitTermination() is used for this:

READ MORE

How to run Scala script with Object on Spark

Suppose you have code like this in Scala: And you run it like this: And you want to put it in a Scala Object so that IntelliJ IDEA doesn’t highlight the code in red. Firstly, you are going to do smth like that: But when you run the script, nothing happens and spark2-shell just opens. […]

READ MORE

Scala + Maven + IntelliJ IDEA project setup

To create a Scala project using Maven to manage dependencies in IntelliJ IDEA, you first need to install the Scala plugin: File -> Preferences (Settings) -> Plugins Search Scala in the Marketplace Install it and restart IntelliJ IDEA Next, let’s create a regular Java + Maven project: File -> New -> Project Select Maven -> […]

READ MORE

Maven import static constant cannot find symbol

Suppose you have a class with constants: And you made the static import of this constant in another class: Everything looks good, and IDEA does not show any mistakes (in fact, there are really no errors in code). But Maven suddenly failed building project with cannot find symbol error. This situation can arise because there […]

READ MORE

Jackson Mismatched Input Exception

Suppose you are trying to do something like: But the output is something like: There are at least two reasons: Configuration file does not exist; Setters for MyConfiguration.class are named incorrectly or cannot be accessed.

READ MORE